Default Owners and Permissions of Files in User Home Directory


I often see users that try to fix an issue and somewhere read or just try to recursively chown their home directory and sometimes even also reset permissions recursively to something like rwxr-xr-x or similar.

Imagine such an owner/permission massacre – are there critical files/directories that need special permissions or to be root-owned for the system to work?

Best Answer

NO file in ~ has to be owned by root.

If a software requires that a file in your home directory be owned by another user, it is a bug and should be reported as such.

Other than that, a common case involves two security-related software that require restricted permissions on certain files, namely:

  1. SSH
  2. GPG


See man ssh, section FILES:

     This is the per-user configuration file.  The file format and
     configuration options are described in ssh_config(5).  Because of
     the potential for abuse, this file must have strict permissions:
     read/write for the user, and not writable by others.  It may be
     group-writable provided that the group in question contains only
     the user.

     Contains the private key for authentication.  These files contain
     sensitive data and should be readable by the user but not acces‐
     sible by others (read/write/execute).  ssh will simply ignore a
     private key file if it is accessible by others.  It is possible
     to specify a passphrase when generating the key which will be
     used to encrypt the sensitive part of this file using 3DES.

Other files like authorized_keys, known_hosts, etc. should be writable only by the user, but can be world-readable.


~/.gnupg (and contents) should be accessible only by you. With other permissions, GPG will complain about unsafe permissions.