File Permissions - InaFricke/SYS-255 GitHub Wiki

When In Doubt PWD (cd ..)

Linux File Permissions

  1. useradd ___

useradd Bob, Fred, Alice

  1. passwd _____

passwd Bob #32Railroad

  1. Ls /home to check they were added

  2. to view directory permissions

image

ls -ld /home/alice

mkdir ____-

to make marketing and management directories

ls -l /

to look at the root of the file system and check for directories

image

  1. add marketing and management

sudo groupadd marketing sudo groupadd management

usermod -aG marketing Bob

usermod -aG marketing Fred

usermod -aG management Alice

  1. create new file in marketing

cd /marketing

to enter the directory I want it in

touch newproducts.txt

to create the file

ls

to check it has been created

image

  1. changing access

chmod uo-rwx newproducts.txt

chmod g+rwx newproducts.txt

ls -l

to check

image

resource: https://www.pluralsight.com/blog/it-ops/linux-file-permissions

I tried to change Fred's permissions and messed up.

sudo chown Fred newproducts.txt sudo chmod 660 newproducts.txt

this did not do what I wanted it to do.

  1. Create bobreview.txt

cd /management

touch bobreview.txt

sudo chmod uo-rwx bobreview.txt

sudo chmod uo-rwx /management


Day 2

su - Alice

image

how is this possible


Day 3

man chown u or u:g

chown

cleaning everything up to try agian rmdir Marketing rmdir Management


su Alice

mkdir Management

groupadd Management

exit

usermod -aG management Alice


Fresh Try

cd /

in root mkdir /management mkdir /marketing

in root groupadd Management groupadd Marketing

in root usermod -aG Management Alice usermod -aG Marketing Bob usermod -aG Marketing Fred

in root chgrp management /management chgrp marketing /marketing

in root chgrp management /management/bobreview.txt

in root chown Alice /management/bobreview.txt

in root chmod u+rw /management/bobreview.txt

ls -la /management

chgrp marketing /marketing/newproducts.txt

chown Fred /marketing/newproducts.txt

chmod u+rw /marketing/newproducts.txt

chmod g-w /marketing/newproducts.txt