Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-27-2005, 11:10 PM   #1
LQ Newbie
Registered: Oct 2003
Posts: 7

Rep: Reputation: 0
Question How to preserve user account information when replacing Linux distro?

I have an old hard disk with a partition dedicated to /home, which contains accounts for my users. However if I remove all the other partitions (/home is still intact) and replace the old fedora partition with Debian Sarge, then how can I let my users be able to log in to the system, use their olf settings and have access to their directories under /home

i.e. other than just the data in the /home directory, how can I preserve the user information (e.g. name and passwords etc. of all people entitled to use this computer) during the upgrade of the operating system?


Old 03-27-2005, 11:31 PM   #2
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Rep: Reputation: 33
You will have to add the /home info in fstab and that should mount it just fine. So far as passwords and stuff goes I'm not so sure. Sorry.
Old 03-28-2005, 06:10 PM   #3
LQ Newbie
Registered: Sep 2004
Posts: 9

Rep: Reputation: 0
Copy the /etc/passwd and /etc/shadow from the old distro to the new installation and you should be fine, also add an entry to the /etc/fstab file for the /home partition.
Old 03-28-2005, 06:19 PM   #4
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
I wouldn't just go replacing /etc/passwd and /etc/shadow of the new system with the files copied from old system. Sounds a bit risky... Better to compare the files and make changes to the new system as needed. At least make backups of the new system's files before replacing them. You might also need /etc/group and /etc/gshadow if you want to keep the group information too.

Last edited by alienDog; 03-28-2005 at 06:20 PM.
Old 03-28-2005, 09:51 PM   #5
LQ Newbie
Registered: Sep 2004
Posts: 9

Rep: Reputation: 0
That's correct, a back up of the system files is mandatory, also the group files are a good idea, since the passwd file holds information of the group a particular user belongs to and that information should match the group files info.

Two things you should keep an eye on is:

First: That the shell is in the path the passwd file is referring, if its not then, I would do a symbolic link to the correct place.

Second: That the shadow file is readable/writable by the root user only.



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
linux create user account deus1 Linux - General 2 06-04-2005 06:32 PM
Best Way to Share User information between applications on Linux illusina Programming 1 04-21-2005 10:24 PM
RedHat Linux user account setup pschaefertx Linux - General 1 03-22-2005 06:29 AM
preserve user/group when copying files km4hr Linux - Software 1 01-11-2005 05:21 PM
How to preserve look of desktop when adding new user? donbellioni Linux - General 1 07-18-2004 04:30 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:24 PM.

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