LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-14-2007, 12:47 PM   #1
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Rep: Reputation: 15
How to backup username/password


Hello everyone,

I have Mandriva 2007.1 (Spring edition) installed on my desktop. I have four users on that machine right now. I would like to create a backup of all their username/passwords so that when I reinstall the OS, I can restore the users on the system to its original state.

How can I do that?

Thanks
 
Old 07-14-2007, 12:55 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Backup the /etc/passwd, /etc/shadow, and /etc/group files and restore them when you reinstall the system.
 
Old 07-14-2007, 02:26 PM   #3
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by btmiller
Backup the /etc/passwd, /etc/shadow, and /etc/group files and restore them when you reinstall the system.
Thanks for the info. I don't have /etc/shadow. What should I do?

Thanks
 
Old 07-14-2007, 03:44 PM   #4
milindlokde
Member
 
Registered: Apr 2007
Location: Mumbai, India
Distribution: Fedora, ubuntu
Posts: 121

Rep: Reputation: 21
Quote:
Originally Posted by alirezan1
I don't have /etc/shadow.
Your system may not be using the /etc/shadow file.

All user information is stored in /etc/passwd file. It includes the user name, password (encrypted), login shell, home directory, etc.
For security reasons most linux systems store the users passwords in a seperate file - /etc/shadow. In this case you will have to backup both /etc/passwd and /etc/shadow files.
 
Old 07-15-2007, 09:17 AM   #5
chris_g_g
LQ Newbie
 
Registered: Jul 2007
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Don't just overwrite the files

Yikes!
You should be careful about just copying the passwd, group and shadow files from one install to another.
If you are doing a reinstall to the same version and distro, not such a worry but still not a good habit to get into.

You should open your old files, copy only the lines that relate to your users and paste them to the end of the new files.

The reason is that the system creates its own users and groups for various purposes. These don't always match up between distros or even between different version of the same distro. Blindly replacing the new with the old overwrites all these system accounts as well which can cause unexpected things to happen.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
username and password no go bmd Linux - Newbie 7 04-06-2005 09:26 PM
username/password sailu_mvn Programming 5 12-21-2004 04:21 AM
UserName and Password luis8460 Red Hat 0 07-08-2004 05:45 AM
Username and Password dance2die Arch 3 09-01-2003 04:32 PM
No username and password Tec1 Linux - Software 1 08-10-2003 10:38 AM


All times are GMT -5. The time now is 12:22 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration