Home Linux System AdministrationBasics 30 Linux Permissions Exercises for Sysadmins

30 Linux Permissions Exercises for Sysadmins

by schkn

This is the set of exercises following the article on Linux Permissions.

If you carefully read the article and understood the principles detailed inside, you should be able to answer most of the questions.

Should you find any errors or imprecisions, feel free to leave a comment.

Good luck!

Linux Permissions Basics

  • Question 1 : connected as devconnected. Here is the output of my ls command.

Will I be able to write into the file some modifications?

  • Question 2 : connected as Bob (which is not part of the devconnected group). Here is the output of the ls command.

Bob wants to move my .profile (located in the devconnected folder) file to the root directory.

Will he be able to do it?

  • Question 3 : connected as Bob (still not part of the devconnected group). Here is the output of the ls command.

Bob wants to go into the devconnected directory.

Can he do it?

  • Question 4 : connected as devconnected. Here is the output of the ls command.

Can I do it?

  • Which file contains a list of users on a Linux system?

Binary Numeral System

  • Question 5 : Convert the binary number 1010001 to the decimal system.
  • Question 6 : Convert the binary number 11011 to the decimal system.
  • Question 7 : Convert the decimal number 12 to the binary numeral system.

Chmod command

  • Question 8 : What permissions will the following command give : “chmod 777” ?
  • Question 9 : What permissions will the following command give : “chmod 444” ?
  • Question 10 : What permissions will the following command give : “chmod 641” ?

Linux permission mask

  • Question 11 : what command should be executed to see the permission mask on Linux?
  • Question 12 : what is the role of the mask on Linux?
  • Question 13 : Given this value for a mask, what permissions will be granted to files on my host?
  • Question 14 : given the same mask, what permissions will be granted to directories on my host?

Directory permissions

  • Question 15 : what does it mean for a user to have the “execute” right on a directory?
  • Question 16 : similarly, what does it mean for a user to have write permissions on a directory?
  • Question 17 : what is used on Linux to create share folders, allowing users to add files to a directory, but preventing them to delete entries that they don’t own?
  • Question 18 : A file is set with the following permissions in a directory with the sticky bit activated. Will I be able to delete the file logged as “devconnected”?
  • Question 19 : logged as john, will I be able to go through this directory? (john is not part of the devconnected group)

Other commands

  • Question 20 : what command is used on Linux in order to change the owner of a file or directory?
  • Question 21 : what command is used on Linux in order to change the group of a file or directory?
  • Question 22 : what option should be specified for the chgrp command to be apply recursively on directories and children?
  • Question 23 : what option should be specified for the chgrp command to write all changes done to the standard output?

SUID & GUID

  • Question 24 : how would you shortly describe the SUID?
  • Question 25 : what popular command is executed on Linux with the SUID enabled?
  • Question 26 : what command woul you run to set the SUID for a file on your host?
  • Question 27 : how would you shortly describe the GUID?
  • Question 28 : what command would you run to set the GUID for a file on your host?

Tricky Questions

  • Question 29 : if a directory with ” r w x r w x r w x” permissions is copied using the cp command, will the permissions be the same on the new directory ?
  • Question 30 : what is the difference between a lowercase “t” and an uppercase “T” for the sticky bit?
Linux administration

You may also like

3 comments

anonymous September 16, 2019 - 4:46 pm

Answers for 19 and 30 are not right. Both T and t mean that sticky bit is set, but execute bit is unset in the first case, while it is set in the latter.

Reply
Linux File Permissions Complete Guide – devconnected October 2, 2019 - 6:45 pm

[…] This article has an exercises article associated with it, read to train on the subject. […]

Reply
30 Linux Processes Exercises For Sysadmins – devconnected October 7, 2019 - 9:01 pm

[…] 30 Linux Permissions Exercises for Sysadmins […]

Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.