LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Ownership Q for two home users (https://www.linuxquestions.org/questions/linux-newbie-8/ownership-q-for-two-home-users-739732/)

cbjhawks 07-13-2009 08:27 AM

Ownership Q for two home users
 
Just reinstalled OpenSuse 11.0 my user 'dad' works fine but for my two
daughters all is not well. First their home directory is owned by the other...ie Amanda is owned by Caitlin and vice verus. When either tries to log in three messages boxes pop up. 1) you do not have write permission to /home/whomever. 2) something called 'dcop is not running, make sure the service is started'. 3) kmserver??? 'cannot be found'

When I go into Yast I can see the ownership problem but even as the root user I'm unable to switch the two owners. Note: when I created the two user's I used a capital letter for their username (ie...Amanda verus amanda) and I got a message box that said this wasnt a good thing to do because the system mail was case senistive....I ignored the message for both girls because I did see any need for them to receive system mail. Their home directories are /home/Amanda and /home/Caitlin so I thought it would be a good idea to match /home with username....apparently not.

So how do I fix this? Delete both users and try again with lower case letters? Would the chown command/program work here from a terminal? Please advise and thanks for your input!

jschiwal 07-13-2009 08:45 AM

As root, look at the contents of /home/ and their home directories.

sudo ls -ld /home/*

ls -ld /home/Amanda
ls -ld /home/Kaitlin

I don't follow what you did to get this problem. I'm wondering if you simply renamed the names of the directories in home.

If the directory /home/Amanda is owned by Kaitlin and the contents as well (and vice versa for Kaitlin) then a quick fix is to simply change the names of the directories. A user's UID and home directory are stored in the /etc/passwd file.

cd /home
sudo mv /home/Kaitlin /home/Kaitlin-old
sudo mv /home/Amanda /home/Kaitlin
sudo mv /home/Kaitlin-old /home/amanda

cbjhawks 07-13-2009 11:54 AM

jschiwal....thanks for your reply
 
The contents of Amanda and Caitlin belong to them...but the permission to access each home directory belongs to the other....ie, the info/data in /home/Amanda belongs to Amanda but the user/group=Caitlin/users....???

I follow your logic with the mv cmd/prg....seems like the easiest. thanks

tredegar 07-13-2009 12:07 PM

If the contents are correct, but the permissions wrong, then maybe just correct the permissions (as root).

Try:
Code:

chown amanda:users /home/amanda
chown caitlin:users /home/caitlin

Then see how it works.

I think it is unlikely (unless you have already been copying things about) that the contents of those directories have acquired incorrect permissions.

However did you get into this mess?

tredegar 07-13-2009 12:12 PM

Quote:

However did you get into this mess?
I think I know.
You just "reinstalled".

Then you added the users caitlin and amanda in the reverse order from your previous install.

So their UIDs (incremented by one as you add each user) are reversed.

User names are mapped from the (numerical) UID.

So they are back-to front.

"Dad" is OK as he added himself first.

If you haven't changed anything yet, you can fix all this up just by editing /etc/passwd

Hope I'm not too late with this advice.

jschiwal 07-15-2009 05:43 PM

If the Ownership & Permissions of /home/Amanda/ and it's contents are for caitlin, then the last post by tredegar is what will fix it.
Make a backup of /etc/passwd before editing. That way if you make a typo, you can copy over /etc/passwd with the backup to restore it, and start over.
sudo cp /etc/passwd /etc/passwd-bu


All times are GMT -5. The time now is 10:54 AM.