How do you safely give a developer read access to /var/log/nginx without sudo?
IntermediateConceptPermissions, Users & sudo
Answer
Use group membership or ACLs rather than changing ownership:
sudo usermod -aG adm dev1 # Debian: nginx logs are root:adm 640
# or a specific ACL that survives logrotate via default ACL on the dir
sudo setfacl -m u:dev1:rx /var/log/nginx
sudo setfacl -d -m u:dev1:r /var/log/nginx
Check that logrotate's create mode does not strip access on rotation.
More on Permissions, Users & sudo
Explain the rwx permission model for files and directories.BeginnerHow does octal notation work in chmod?BeginnerWhat does chown do and who can run it?IntermediateWhat is umask and how is the final permission calculated?IntermediateWhat is SUID and give a real example?IntermediateWhat does SGID do on files versus directories?Intermediate