LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Where is the root password located? (https://www.linuxquestions.org/questions/linux-general-1/where-is-the-root-password-located-496050/)

tobiasw 10-27-2006 08:13 AM

Where is the root password located?
 
Hello everybody,
do you know in what file the root password is stored? So that if i am doing a image copy can replace that file...

Thanks

Tobias

pixellany 10-27-2006 08:24 AM

Passwords are typically encrypted and stored in /etc/shadow.

If I were making images for installing, I would first DISABLE the root password. Then, in the new install, the first user will simply enter "passwd root" to make a new one. (When first logging in as root, the system will not ask for a password)

To disable the root password, edit the /etc/passwd file and remove the "x" in this line:
root:x:<snip>
so it looks like this:
root::<snip>

tobiasw 10-27-2006 12:24 PM

Thanks for the help. Is it possible to copy /etc/shadow from one linux to another?

pixellany 10-27-2006 12:30 PM

Quote:

Originally Posted by tobiasw
Thanks for the help. Is it possible to copy /etc/shadow from one linux to another?

Possible--maybe
Advisable--probably not

Look at the contents of the file and ask yourself if all the listed users are going that have all the same parameters in a different system.

If you are imaging the SAME install to another box with the same hardware, then it should work fine.

nayyares 10-27-2006 03:15 PM

Hi,

/etc/shadow is made automatically, and there is a copy of its default with name /etc/shadow- , shadow file is updated automatically when you create, modify a user so there will be difference in two seprate machines /etc/shadow files.

btw, it is possible to take it from one machine to another, but it will cause problem if /etc/passwd and /etc/shadow has difference.

thanks


All times are GMT -5. The time now is 05:19 PM.