Linux File Permissions - jude-lindale/Wiki GitHub Wiki
Watch the file permissions video and create the users, directories and groups described in the video.
Then create a new user called Fred and two new groups called Marketing and Management
Bob and Fred should be in the Marketing Group
Alice should be in the Management Group
Create directories /marketing and /management
Solve the following file access control issues:
- Only the marketing group should have access to a file you create called /marketing/newproducts.txt
- Bob and Fred should be able to see newproducts.txt, but only Fred should be able to modify the file
- Alice is the manager. The new file, /management/bobreview.txt should only be accessible to Alice and the management group
As root provide a screenshot showing the results of
ls -ld /marketing
ls -l /marketing
ls -ld /management
ls -l /management
create groups
groupadd mygroup
create user
sudo useradd username
sudo passwd username
create directory
mkdir directoryname
add user to group
usermod -aG g groupname username
permissions
- r - can read
- w - can write
- x - can execute
- u - user
- g - group
- o - other
- a - all
chang directory permissions
chmod +rwx filename
chmod -rwx directoryname
chmod +x filename
chmod -wx filename
change users primary group
usermod -g groupname username
Change ownership
chown name filename
chown name foldername
chnage permissions for group owner
chmod g+w filename
chmod g-wx filename
Change permission for group users
chmod o+w filename
chmod o-rwx foldername