In this project, i learnd about all the linux permission.learnd about all the command chmod,sudo,su,chown,chgrp,id,groups,whoami,adduser,useradd and addgroup commands. how change ownership of a file and a dir to a group. changing permission of the the file in a different way.
- chmod
- sudo
- su
- chown
- chgrp
- id
- groups
- whoami
- adduser
- useradd
- addgroup
- 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
- 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
- Allowed editors: vi, vim, emacs
- All your scripts will be tested on Ubuntu 20.04 LTS
- All your scripts should be exactly two lines long ($ wc -l file should print 2)
- The first line of all your files should be exactly #!/bin/bash
- A README.md file, at the root of the folder of the project, describing what each script is doing
- You are not allowed to use backticks, &&, || or ;
- All your files must be executable
- My name is Betty : A script that switches the current user to the user betty.
- Who am I : A script that prints the effective username of the current user.
- Groups : A script that prints all the groups the current user is part of.
- New owner : A script that changes the owner of the file
hello
to the userbetty
. - Empty! : A script that creates an empty file called
hello
. - Execute : A script that adds execute permission to the owner of the file
hello
. - 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
. - Everybody! : A script that adds execution permissions to the owner, the group owner and the other users, to the file
hello
. - 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.
- 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. - Look in the mirror : A script that sets the mode of the file
hello
the same asolleh
's mode. - 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.)
- More directories : A script that creates a directory called
dir_holberton
with permissions 751 in the working directory. - Change group : A script that changes the group owner to
holberton
for the filehello
. - Owner and group : A script that changes the owner to
betty
and the group owner toholberton
for all the files and directories in the working directory. - Symbolic links : A script that changes the owner and the group owner of
_hello
tobetty
andholberton
respectively. - If only : A script that changes the owner of the file
hello
tobetty
only if it is owned by the userguillaume
. - Star Wars : A script that will play the StarWars IV episode in the terminal.