Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ======6.2.9 Ensure users own their home directories (Scored)====== =====Profile Applicability===== <code> Level 1 - Server Level 1 - Workstation </code> =====Description===== The user home directory is space defined for the particular user to set local environment variables and to store personal files.. =====Rationale===== Since the user is accountable for files stored in the user home directory, the user must be the owner of the directory. =====Audit===== Run the following script and verify no results are returned: <Code:bash> #!/bin/bash cat /etc/passwd | awk -F: '{ print $1 " " $3 " " $6 }' | while read user uid dir; do if [ $uid -ge 1000 -a -d "$dir" -a $user != "nfsnobody" ]; then owner=$(stat -L -c "%U" "$dir") if [ "$owner" != "$user" ]; then echo "The home directory ($dir) of user $user is owned by $owner." fi fi done </Code> =====Remediation===== Change the ownership of any home directories that are not owned by the defined user to the correct user. ubuntu1604/6/2/9.txt Last modified: 2017/05/04 14:38by Piotr Kłoczewski