How To Configure Home Directories Permission on Linux
Posted by Planet Malaysia on August 18, 2008
In order to change all home directory permission, I will run the following script:
for DIR in \
`awk -F: '($3 >= 500) { print $6 }' /etc/passwd`; do
chmod g-w $DIR
chmod o-rwx $DIR
done
Basically the script as above will remove WRITE permission for group, remove READ, WRITE, EXECUTE for other for any user ID larger than 500 on Linux.
List the directory again and the result should be same as below:
sles9:/home # ls -lth
total 60K
drwxr-x— 7 test users 4.0K Nov 29 2008 test
drwxr-x— 7 test1 users 4.0K Nov 25 2008 test1
drwxr-x— 7 dell users 4.0K Sep 7 2008 dell
drwxr-x— 7 test2 users 4.0K Aug 18 11:52 test2
Done!
Possibly Related Posts:
- How to add Dell PERC Drivers into VMware Converter Cold Clone ISO
- Top 10 Free Anti Virus
- How to Install Webmin on OpenFiler
- Microsoft SQL 2008 Agent not starts
- VMware Workstation 7 Serial Key
Comments
Leave a Reply