103-permissions.md

October 4, 2017 ยท View on GitHub

Unit 3: Permissions

cd /
touch test.txt
sudo !!
cd -
touch test.txt
chmod u-w test.txt
nano test.txt
man sudo
cat /etc/passwd ## list all users on the machine

List view.

Figure 2 Via Via UC Irvine

Notes: Think twice before sudo. The user flags are u for user, g for group, o for other, a for all. The permission flags are r for read, w for write, and x for execute. chmod -x test.sh implies chmod a-x text.sh.

Explore: IBM developerWorks: Manage file permissions and ownership

Bonus:

octaldecimalls -lpermission
0000 (0+0+0)---none
0011 (0+0+1)--xexecute
0102 (0+2+0)-w-write
0113 (0+2+1)-wxwrite + execute
1004 (4+0+0)r--read
1015 (4+0+1)r-xread + execute
1106 (4+2+0)rw-read + write
1117 (4+2+1)rwxread + write + execute

Instead of chmod +rwx test.txt (give everyone permissions to everything) you can use chmod 777 text.txt.