Ultimate Linux Tutorial P2 [DRAFT]

Linux is not your grandfathers operating system. it is different in many ways and will have a much steeper learning curve. its like a elephant – hardest part is trying to figure out where to take the first bite. Have fun continuing to grow out your next beard.

Lets move onto some more advanced stuff. A warning is in order though. from here on out you can run the risk of bricking your linux install if you are not careful in taking the proper steps to ensure that your install lasts. Triple check your commands before you run them especially when you run them as root. I would recommend using a VM if you feel unsafe from here as a data loss is no joke.

The first thing we are going to learn is permissions. if you have ever run " ls -l " then you have noticed alot more verbose information being displayed. Some of this information is the permissions information

drwxrwxr-x root wheel 4096 Mar 9 14:04 Folder

the first character is the type bit. Lets the system know what type of file it is. In this case the type bit is " d " for directory. this will be " - " for regular files. the next 9 characters are the permission octals. After that is the owner and group permissions. Those let the system know who can and cant access the files and how the can access the files. the permission octals are spilt into 3 sections of 3. the first section is owner permissions, the second section is for group permissions, and the last section is the world permissions. world permissions apply to anyone not specified by owner and group permissions. We will cover users and groups when we make our way into user management

The octal bits are easy once you know what they are.

7 - read, write, and execute
6 - read, and write
5 - read on execute
4 - read
3 - write and execute
2 - write
1 - execute
0 - no access

Octal bits are just added together to get the permissions you want. 4 + 2 = 6 so users would only be allowed to read and write to files but not able to execute them. there are special cases as always though. access to folders can be limited by removing the execute bit. this will prevent users from being able to cd into the folder.

now we can move onto the fun stuff like commands.

chmod 644 foo.txt - sets foo.txt to read and write by owner and readable for everyone else
chmod +x program.bin - allows executing program.bin
chmod -x program.bin - removes the ability to run program.bin
chmod +r -R foo - recursively adds read permissions to the folder foo
Some great sites and such you should check out

Unix Toolbox
https://linuxjourney.com/
https://unix.stackexchange.com/
https://wiki.archlinux.org/

Do not consider these tutorials complete. i plan on updating them to fix errors and to add anything i might have missed in the past.

feel free to post if you have any questions, comments, etc. will be glad to help

1 Like