Linux Up Skill - Day 13

Linux Up Skill - Day 13
Photo by Anders Jildén / Unsplash

I’m going to work on lesson 13 of the Linux Up Skill Challenge. Today’s lesson is titled “Who has permission?” It has been eons since I’ve worked with Linux permissions but do remember doing this on my gaming servers and when setting up web servers so hopefully it won’t take too long to get back into the swing of it.

The lesson starts with an explanation of permissions and then has you create a file called tuesday.txt. vim tuesday.txt. I then add some additional text and save. Now I look at the permissions: ls -ltr tuesday.txt.

david@linux-up-skill:~$ ls -ltr tuesday.txt -rw-rw-r-- 1 david david 41 Jun 29 13:17 tuesday.txt

Then it has me change the permissions to the file.

david@linux-up-skill:~$ chmod u-w tuesday.txt david@linux-up-skill:~$ chmod g-w tuesday.txt david@linux-up-skill:~$ chmod o-r tuesday.txt david@linux-up-skill:~$ ls -ltr tuesday.txt -r--r----- 1 david david 41 Jun 29 13:17 tuesday.txt

Now I can’t write to the file as expected. So to give permissions back I run chmod u+w tuesday.txt. Next the lesson has me working with groups. So I’ll need an additional user. sudo adduser fred. Then I switch to fred with sudo su fred. When I check groups it shows he is only a member of the group fred. So I switch back to myself and run sudo usermod -a -G sudo fred. If I switch back to fred and run groups again I see he is member of fred and sudo.

The lesson finishes with you researching umask and the old school octal mode of file permissions. Good old times for sure.