LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-27-2006, 08:13 AM   #1
tobiasw
Member
 
Registered: Oct 2006
Distribution: Fedora Core
Posts: 60

Rep: Reputation: 15
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
 
Old 10-27-2006, 08:24 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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>
 
Old 10-27-2006, 12:24 PM   #3
tobiasw
Member
 
Registered: Oct 2006
Distribution: Fedora Core
Posts: 60

Original Poster
Rep: Reputation: 15
Thanks for the help. Is it possible to copy /etc/shadow from one linux to another?
 
Old 10-27-2006, 12:30 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 10-27-2006, 03:15 PM   #5
nayyares
Member
 
Registered: Oct 2006
Location: JNB, SA
Posts: 33

Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
change Root Password even if the password in the grub is also set sheelnidhi Linux - General 6 08-30-2006 07:27 AM
Password Recovery with co-located boxes anth2oo1 Linux - Security 2 03-08-2003 02:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration