View Full Version : Moving Profiles Around ?

10th January 2007, 08:19 AM
what is the secret here,
I had a problem with a profile that I changed the name on,
so I deleted the user account and recreated it,
I backedup the profile dir, deleted it and when I created the user again,
it created a folder for the new user,
but the user can't access the home folder now...

If someone could please tell me how to do this flawlessly I would be very greatful,
what are the key files involved and what permissions should each file have?

when I recreated the user, it only put 3 hidden files in the home dir so this can't be that hard...
I should be able to create a user on a new PC, copy the home dir over,
delete the default home dir ,name the dir the same as the new user,
set the permissions, and now be able to login as that user,
without see any error messages...


10th January 2007, 08:28 AM
thats not necessarily true. There are a couple of issues here.
First, if you create a user on one system and simply move the home directory to another system, the user will never be able to login because there is no entry in /etc/passwd for the user.
Second, when you create a user a UID and GID are assigned to that user. If these do not match what may currently be in /etc/passwd for that user, you will have similar problems.

10th January 2007, 11:03 AM
When you create the new user, all you need do is copy the contents of the backed up directory into the home directory of the new user. So if you backed up /home/olduser and have on the new pc a user called newuser with home directory /home/newuser, there is no need to delete the directory /home/newuser. Just copy what is in /home/olduser into /home/newuser and all should be well.

10th January 2007, 06:01 PM
When I create users, they can't login ?
it says the dir does not exist, but it does...

Controling users and groups in Linux leaves much to be desired,
why can't I assign a group as owner of an object(file or dir)?


10th January 2007, 06:06 PM
how can I logout from the terminal ?

10th January 2007, 06:10 PM
Should I use seLinux or not ?
enforcing or passive ?

10th January 2007, 11:57 PM
I think I see a pattern,
new users can't login using their home directory, because it is on a mounted drive,
I think it has to do with permissions...
I mount my data drive to /home so I can store profiles in a separate drive,

any idea how to fix this issue ?
another clue: I just started using seLinux in enforcing mode...

any ideas?


14th January 2007, 05:52 PM
First I would stay away from selinux till you can understand exactly what it is. Google around on articles on seleinux to get the understanding what it can do.

To exit a session use the command ' exit'

Now if you deleted the user and created a new one then the problem is like described above the new user even though is the same name as a new UID and GID number. To fix this as root copy the file the users originally had back to the new /home/username directory. Then from /home directory as root run the following commands.
chown -R username directory_name
chgrp -R username directory_name

chown -R bob bob
or chown -R bob /home/bob

Now to understand the UID and GID look at the file /etc/passwd. Do not edit it as root but a user can see it.
Search ggole for info on what each section on the /etc/passwd means.

Now as long as the /home is the one defined in /etc/fstab or with the combination of /etc/mtab and /etc/fstab then this is the location of home users account.