Jump to content

Ownership and permissions for /home


RobF
 Share

Recommended Posts

I recently installed Mandrakelinux 10.0 and went along pretty much with the default choices of the installer to take all the space that I'd freed up on my second hard disk. The installer proceeded to set up three separate partitions, one for / with all the system subdirs underneath it, one for swap space, and one for the /home dir.

 

Subsequently, I decided to shrink the /home partition, and in the process moved the /home dir into the root partition, and then after resizing the former /home partition, moved the /home dir back into the resized /home partition.

 

Anyway, I believe that in the copying process the ownership and permissions for the /home dir somehow got changed, and now KDE can't start up for user robert in /home. The error messages from KDE are: "An error was detected when establishing interprocess communication for KDE", "Could not read network connection list .... verify the dcopserver program is running", "KDE is unable to start ..... No write access to $HOME directory /home/robert", "Config files blah blah blah in /home/robert/.kde not writable", "Could not start ksmserver", etc.).

 

I think the problem may be that I need to reset the ownership and permissions for /home to the original values. What would be the name for the owner and for the group and the access permissions for both the /home dir and my own home dir /home/robert? Could somebody who has got the same partition configuration as I do (i.e. a separate partition for /home), please relate those values to me or guide me to some MDK reference that gives that info?

 

Many thanks in advance.

 

Robert

Link to comment
Share on other sites

cannonfodder, I used Konqueror as root to copy /home from hdb7 to hdb5, not the command line. That changed the permissions so that I wound up with the following for my /home/robert folder:

 

drwxr-xr-x 79 root root 4096 Jul 11 01:04 robert/

 

KDE couldn't handle that and hung. I changed it by typing, as root

 

chown -R robert.robert /home/robert

 

Doing ll /home now yields

 

drwxr-xr-x 79 robert robert 4096 Jul 11 01:04 robert/

 

That seems to have fixed the problem, and it looks as though that was the only thing I needed to do - everything is working fine again, at least in some preliminary testing.

 

But according to Steve the user and group membership should be

 

drwxr-xr-x 79 robert xgrp 4096 Jul 11 01:04 robert/

 

What should it be? Another user advised me to also check my home dir permissions and adjust them appropriately, and he suggested the command

 

chmod -R 755 /home/robert

 

What are the correct settings, and what does the chmod command do? Could someone comment? Thanks.

Edited by RobF
Link to comment
Share on other sites

This is somewhat off topic but related.

I recently broke my installation beyond what I could repair so in order to preserve my files, I moved my whole /home directory to a seperate location.

Then I re-installed Mandy 10 OE with the same user name, and then copied the old /home directory back over the one created in the fresh install.

 

I wasn't terribly surprised when loads of things stopped working.

Although the /home directory permissions had the same user name as the one I was logged on as, I was not actually the same user who'd created the directory as far as Linux was concerned. Hence I had no write access to the /home directory.

 

This would come as no surprise to anyone who has, like me, done any kind of system admin before, but it might be confusing to anyone fresh from a single user Windows world who has never had to worry about user IDs before.

 

To solve this I used the 'Properties' dialogue in Konqueror as root (forgive me, I'm still more comfortable in gui land than with the CLI...but I'm making progress! :P ) to change the owner and group to 'root' - apply changes - then change them back to 'username'.

 

I noticed that if I simply overtyped 'username' with 'username' the system didn't recognise that any change had been made and so didn't make any changes to the permissions on the file. Hence the need to change to 'root' as an intermediate step.

 

Sorry to stray opff topic a bit. To get back on track...

 

Rob, if you've done a standard install, I believe you should have a user with the user name you supplied as well as a group with the same name.

So having the permissions as

drwxr-xr-x 79 robert robert 4096 Jul 11 01:04 robert/

Is just fine.

 

Steve has created a separate group to which he could add other users called 'xgrp'. Members of that group can read and execute files in his home directory but not alter them.

 

chmod changes the permissions on files.

755 indicates the permissions for owner, group and others.

1st number = owner. In this case 7 = Write eXecute and Read

2nd number = group. In this case 5 = eXecute and Read only.

3rd number = others. In this case 5 = eXecute and Read only.

 

The only difference this would make to you is that 'others' would be able to read your files as well as just executing them.

 

Check this out for more detailed info.

Link to comment
Share on other sites

Thanks, Ed, for the interesting info and the link to a readable write up about chmod. I checked the permissions on my home folder /home/robert, using Konqueror > F9 > Properties > Permissions. They do indeed match 755 which is also equivalent to drwxr-xr-x, i.e. owner rwx, group r-x, other r-x. So all is well.

 

Interestingly, when I do ls -l (or ll) on /home from within Mandrake, I get the line

 

drwxr-xr-x 79 robert robert 4096 Jul 11 01:04 robert/

 

When I do it from within another Linux OS, I get

 

drwxr-xr-x 79 501 501 4096 Jul 11 01:04 robert/

 

Wonder why that is so and what the 501 means.

 

Robert

Link to comment
Share on other sites

Robert,

 

501 is the uid of user robert on your system; that other system doesn't know which user 501 is, so just puts the number. Read your /etc/passwd file (as root if necessary) and you'll see the uid's of all users. Usually your home dir should have owner and group set to same as the username, so you're all set now.

 

Ed, you've done system administration before but prefer to run konqueror as root to do an ownership change? Hmm, let me guess on what systems you have done administration, Solaris? BSD? HP-UX? Still wrong eh? :)

The CLI is the most powerful admin tool, period. All imho, but an opinionI share with all good admins I have seen IRL...

But I agree, it takes getting used to, and you know you've been messing with linux too much once you find yourself at any device with buttons and you're thinking: darn, wish this thing had a keyboard so I could just tell it what I want instead of going through all these menus...

Link to comment
Share on other sites

Ed, you've done system administration before but prefer to run konqueror as root to do an ownership change? Hmm, let me guess on what systems you have done administration, Solaris? BSD? HP-UX? Still wrong eh?

 

Hehe! Yep! You got me. :P

Windows born and bred!

 

I WILL get to grips with the CLI. Making progress already, but sometimes when you just want something to work NOW (like when you have no write access to your home directory :P ) you go back to what you know best!

 

I'll get there. Bad Windows habits are hard to break it seems. :wall:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...