Results 1 to 4 of 4

Thread: Home directory permissions and owners.

  1. #1

    Default Home directory permissions and owners.

    Hi,

    I have a laptop running 13.2 with ext4 on the / and /home partitions. Last week it started having problems using pulseaudio which had been working fine for years. I tracked down the fault and fixed it - the cause was that the owner:group on my /home/chris folder was 114:users. Changing the owner with chown back to chris:users fixed things. I also left it set with permissions 0755.

    However, searching through google and some forums I can't find a definitive answer as to why the owner should change by itself. I don't 'fiddle' or experiment or load sus software with this laptop but I do remember the problem started after a weekly upgrade from the standard repos.

    Can anyone shed any historical light on owner change (does it happen?) or do I just leave it as 'one of those things'? I know I am user 1000 so who is user 114? I am the only user on the laptop.

    As a bonus question, I have a second laptop running 42.2 which has the owner on the /home/chris directory correct but it's permissions is set to 0777 - that is how it was setup during the install. Should permissions on home directories be 0770?

    Thanks,
    Chris.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,853

    Default Re: Home directory permissions and owners.

    I can not answer the question on how the owner of chris' home directory was changed from chris (1000) to 114. But I can make some general remarks that may help you with some understanding.

    While you may see yourself as the "only user" of the sytem, that is only so seen from the human aspect. The system does not know any human people. it knows userids (numbers, and 1000 being one of them), that have a user name attached (chris attached to 1000, but also root attached to 0). All these userids are defind in /etc/passwd. When you look in this file, you will find not only root and chris, but at least a 20 more. So saying that the system has only one user is not true from the system's point of view and that is the point of view we have to understand when we want to understand how the system functions.

    You ask: "who is user 114". You will now understand that you then have to look in /etc/passwd, where the second column (: separated) has the userid and the first the attached name. As said you will find entries beginning with:
    Code:
    root:0:
    chris:1000:
    But you will NOT find and entry with 114. I know that because then you would not have reported 114:users as owner, but the user name instead.
    So chris' home directory was, for whatever reason, owned by userid 114, which is not defined in /etc/passwd (and btw, thus unable to log in).

    The permission of home directories are rwxr-xr-x by default.
    The system administrator (using root) can change that on user creation (either by changing this so that all new created users get another setting, or setting it individual for a new created user).
    The user, being ultimate responsible for protecting his/her data, can change that when wanted. E.g. to rwxr-x--- when (s)he wants to block users outside the group users, or even to rwx------ to block all other users.
    BTW, that is possible, because the parent directory of the user's home directory (being /home) has the permissions:
    Code:
    henk@boven:~> ls -ld /home
    drwxr-xr-x 10 root root 4096 17 jan  2014 /home
    henk@boven:~>
    and thus r-x for all users.
    Thus if chris wants to set it to rwxr-xr-x or rwxr-x--- is up to chris. If root wants to set it to any value on new user creation is up to root (IIRC this can be set up somewhere in YaST > Security and Users > Users and groups), but root must understand that the user can change that later.

    And, if chris wants to set it to rwx-r-x--- (or rwx------), he might also want to set an umask of 027 (or 077) to protect newly created files.

    But as you say, chris is basically the only user ever to log in, one can ask how important such a protection is. OTOH, it does not harm also because there are no other users chris might want to allow access.

    I hope this answer your secondary questions. No idea why the owner change to 114. Nor what is so special about userid 114.
    Henk van Velden

  3. #3

    Default Re: Home directory permissions and owners.

    Hi Henk,

    I think I may have discovered the problem. User 114 is on my NFS server from which I was doing some rsync transfers last week. My history log shows that one of my rsync commands didn't have the -a option set (preserve ownership - which I assume means set the ownership to the target directory ).

    I found the actual files on the target PC set to owner 114. I guess somehow my home directory was affected too. Something for me to test in a VM.

    Need to be careful with my rsync I guess.

    Regards,
    Chris.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,853

    Default Re: Home directory permissions and owners.

    In any case, it is where the number 114 comes from.

    NFS assumes that UIDs and GIDs are coordinated through all systems concerned. Either by good manual system management, or by using NIS.

    When this is not done the ownership/permissions feature of Unix/Linux is comprimated.
    Henk van Velden

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •