Computing.Net > Forums > Linux > getting back root user

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

getting back root user

Reply to Message Icon

Name: 123456
Date: August 27, 2008 at 09:43:53 Pacific
OS: linux
CPU/Ram: 256
Comment:

i have changed /etc/passwd file as follows--
foo:x:0:0:/root:/bin/bash
i.e. in the first line I replced first"root" by foo and rest of the things left unchanged.

now I am not able to login either as root or as foo.
Is there is solution to get root user back?



Sponsored Link
Ads by Google

Response Number 1
Name: Shadowlight
Date: August 27, 2008 at 14:27:35 Pacific
Reply:

First, the :x: in your /etc/passwd tells you that the password for that user is stored in /etc/shadow so if you change one you need to change the other also.

Now how to get it back..

1) Boot from a live CD
2) mount the / from your system on /mount (create the directory first)
3) edit /mount/etc/passwd and put root back in place or edit /mount/etc/shadow and make root foo
4) reboot the system.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: getting back root user

NIS problem with non-root user www.computing.net/answers/linux/nis-problem-with-nonroot-user/14927.html

non root users cannot mount floppy www.computing.net/answers/linux/non-root-users-cannot-mount-floppy/22426.html

hard disk spindown as non-root user www.computing.net/answers/linux/hard-disk-spindown-as-nonroot-user/22122.html