Linux File Permissions - Galen-Dively/SYS250-02-Journal GitHub Wiki
Before doing anything I use sudo -i
to become root temporarily.
Creating new user:
I need three new users: Bob, Alice, and Fred.
This will be accomplished using adduser name
replacing name with the name of the user each time.
Creating Groups
Next I need to create two new groups: marketing and management.
Using groupadd 'group'
replacing 'group' with each of the groups will create our groups\
Adding user to group
Adding Fred and Bob to Marketing: usermod -aG marketing fred && usermod -aG marketing bob
Adding Alice to Management: usermod -aG management alice
Creating directory
This lab calls for two directories to be added to my root home directory, marketing and management. Using `mkdir ~/marketing && mkdir ~/managment'
Securing Files
Securing files for Bob and Fred
To secure the ~/marketing/newproduct.txt: 'chown :marketing ~/marketing/newproduct.txt' to give ownership to the marketing group.
Next I used chmod 640 /marketing/newproduct.txt
to give read and write permissions to the owners of it.
To make sure only Fred can write on the file I will use setfacl -m u:bob:r /marketing/newproducts.txt
to make sure bob can only read and sudo setfacl -m u:fred:rw /marketing/newproducts.txt
to have bob read and write.
Securing Files for Alice
For alice I will be securing the ~/managment/bobreview.txt.
Using chown alice:management ~/management/bobreview.txt
again but this time with the management group and folder.\