Skip to content

Latest commit

 

History

History

0x01-shell_permissions

img

shell permissions

Intro

Lets have a look at shell permisions

Resources

  1. Permissions
  2. File permissions
  3. Google
  4. Youtube

Man or help

  • chmod
  • sudo
  • su
  • chown
  • ```chgrp`## Quizes Quiz``
  • id
  • groups
  • whoami
  • adduser
  • useradd
  • addgroup

Learning objectives

By the end of this project, you should be able to explain to anyone Without the help of google the following concepts

Permissions

  • What do the commands chmod, sudo, su, chown, chgrp do
  • Linux file permissions
  • How to represent each of the three sets of permissions (owner, group, and other) as a single digit
  • How to change permissions, owner and group of a file
  • Why can’t a normal user chown a file
  • How to run a command with root privileges
  • How to change user ID or become superuser

Other man pages

  • How to create a user
  • How to create a group
  • How to print real and effective user and group IDs
  • How to print the groups a user is in
  • How to print the effective userid

Tasks

  1. My name is Betty : A script that switches the current user to the user betty.
  2. Who am I : A script that prints the effective username of the current user.
  3. Groups : A script that prints all the groups the current user is part of.
  4. New owner : A script that changes the owner of the file hello to the user betty.
  5. Empty! : A script that creates an empty file called hello.
  6. Execute : A script that adds execute permission to the owner of the file hello.
  7. Multiple permissions : A script that adds execute permission to the owner and the group owner, and read permission to the other users, to the file hello.
  8. Everybody! : A script that adds execution permissions to the owner, the group owner and the other users, to the file hello.
  9. James Bond : A script that gives the gives the rest of the users permission and removes all permission for the owner and the group owner.
  10. John Doe : A script that sets the mode of the file hello; where owner has all the permissions set, group owner has execute permissions set and others have only write and read permissions set.
  11. Look in the mirror : A script that sets the mode of the file hello the same as olleh's mode.
  12. Directories : A script that adds execute permission to all subdirectories of the current directory for the owner, the group owner and all other users. (NB: Regular files should not be changed.)
  13. More directories : A script that creates a directory called dir_holberton with permissions 751 in the working directory.
  14. Change group : A script that changes the group owner to holberton for the file hello.
  15. Owner and group : A script that changes the owner to betty and the group owner to holberton for all the files and directories in the working directory.
  16. Symbolic links : A script that changes the owner and the group owner of _hello to betty and holberton respectively.
  17. If only : A script that changes the owner of the file hello to betty only if it is owned by the user guillaume.
  18. Star Wars : A script that will play the StarWars IV episode in the terminal.