?
Solved

Moving linux users

Posted on 2005-03-04
3
Medium Priority
?
225 Views
Last Modified: 2013-12-15
Hi, I have a SuSe 9.1 box serving terminals with a whole bunch of users on it, I wish to move all these users to a redhat box, is there an easy way to do this?

I can easly copy and paste the /home directory but don't know how to move the usernames and passwords files so these chaps can seamlesly log in again.
0
Comment
Question by:iqula
3 Comments
 
LVL 8

Accepted Solution

by:
marxy earned 1600 total points
ID: 13460158
You need
1. Move homes. Usually they are in /home
On source (suse)
tar cfvz homes.tar.gz /home

On target (redhat)
tar xfvz homes.tar.gz /

2. Move group and users and passwords
copy these files to redhat
/etc/group
/etc/passwd
/etc/shadow

NOTE: These files contain not only users. These are system accounts too.
If they are different on suse and redhat do the following.
- copy these files somewhere
- remove values with id's lower than 500 (usually users accounts start with 500)
- paste the rests of the files to redhat files
0
 
LVL 12

Expert Comment

by:mburdick
ID: 13464044
If all of the users are configured as system users (/etc/passwd), then no, there isn't an "easy" way to do this.

You mention you want to go from SuSE 9.1 to RedHat. The last RedHat release (other than enterprise level server software) is 9.0, and is much older than SuSE 9.1. Are you really going to move the users to RedHat? Or, is it Fedora?

At any rate, why would you move the users from a distribution that supports the Linux Standards Base and was the first mainstream release to use the 2.6 kernel? What's so appealing about RedHat?

I've used both, and in my mind, there's no comparison - SuSE is far superior.
0
 
LVL 38

Assisted Solution

by:wesly_chen
wesly_chen earned 400 total points
ID: 13464557
Hi,

  Some comments I would add to marxy's method:
1. Make sure the all user's home directories are the same. Also make sure the RedHat box has enough space in home directory.
   marxy's method has already preserve the uid/gid as well as the /home directory path. If you have user's home dirs are not under
   /home, then you need to use tar to copy over.

2. Append those 3 files (passwd, shadow, group) from SuSE to RedHat.
   Say
cat /etc/passwd_suse >> /etc/passwd
cat /etc/shadow_suse >> /etc/shadow
cat /etc/group_suse >> /etc/group
 Then edit those 3 files to remove duplicated account  which is original in SuSE's files, such as system accounts or application
accounts (bin, sys, mysql, ldap etc...).
   
   I hope this help.

Regards,

Wesly
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Virtualization software lets you run different versions of Windows, Ubuntu Linux and other versions of Linux all at the same time, rather than running each one directly from your computer's hard drive.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month4 days, 9 hours left to enroll

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question