File Permissions - InaFricke/SYS-255 GitHub Wiki
When In Doubt PWD (cd ..)
Linux File Permissions
useradd ___
useradd Bob, Fred, Alice
passwd _____
passwd Bob #32Railroad
-
Ls /home to check they were added
-
to view directory permissions
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
- add marketing and management
sudo groupadd marketing
sudo groupadd management
usermod -aG marketing Bob
usermod -aG marketing Fred
usermod -aG management Alice
- 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
- changing access
chmod uo-rwx newproducts.txt
chmod g+rwx newproducts.txt
ls -l
to check
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.
- Create bobreview.txt
cd /management
touch bobreview.txt
sudo chmod uo-rwx bobreview.txt
sudo chmod uo-rwx /management
Day 2
su - Alice
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