LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Modified "/etc/passwd", unable to login as root! (https://www.linuxquestions.org/questions/linux-general-1/modified-etc-passwd-unable-to-login-as-root-778432/)

tulsi 12-28-2009 04:54 AM

Modified "/etc/passwd", unable to login as root!
 
Hi guys,


I made mistake in /etc/passwd file(Cent OS). In the file I change root::/bin/bash to /sbin/nologin. so I cannot enter the root. but I enter the users and i tried to change /bin/bash but permission denied.

please help me. its a important and urgent one.
Thank you.

zQUEz 12-28-2009 05:13 AM

Use a Linux install cd/dvd and start into rescue mode. For a Red Hat based Linux distro (e.g. CentOS), at the start prompt, type `linux rescue`. Work through the prompts until it drops you to a shell. Then edit your /etc/passwd which should be mounted under `/mnt/sysimage`.

dctw 12-28-2009 05:14 AM

Have you tried booting up in Single User Mode?

tulsi 12-28-2009 05:23 AM

yes I tried but cannot enter the single user mode
becoz display like
/dev/root no such a file directory
and something

Aquarius_Girl 12-28-2009 05:31 AM

tulsi

Label your thread title as follows:

Quote:

Modified "/etc/passwd", unable to login as root !
It will help u fetch more answers since many members do not bother to look into the threads labeled "Urgent".

chanduderoyal 12-28-2009 05:34 AM

better to use rescue mode

linus72 12-28-2009 05:38 AM

seems pretty simple...

boot up any ubuntu or debian-live cd
autologin to user desktop
open a terminal and become root

sudo su

open a file manager as root (example ubuntu)

sudo nautilus

and then edit /etc/passwd

your done:)

tulsi 12-28-2009 06:50 AM

Thanks all of you


The problem will be solved

I tried to single user mode again in grub edit menu -> then end of second line like vmlinuz .....quiet S (i enter S) then go to runlevel 1 and I change the /etc/passwd file.



Thanks for all once again

XavierP 12-28-2009 10:53 AM

I've fixed the thread title to make it easier to find and search for.


All times are GMT -5. The time now is 07:02 AM.