Linux Permissions

From csn
Revision as of 06:22, 13 February 2020 by David (talk | contribs) (Created page with "Log in to your Ubuntu machine. <BR> (For External and offshore students, please use the Ubuntu virtual machine used in previous labs. Open a terminal by clicking the Ubuntu i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Log in to your Ubuntu machine.
(For External and offshore students, please use the Ubuntu virtual machine used in previous labs.

Open a terminal by clicking the Ubuntu icon in the top left of the Desktop screen.

Type terminal and hit enter.

Create three different users: Alice, Bob and Mallory. Create a directory called 'shared' in /home/. Create ten files inside it. Ensure that this folder has the User group and permissions to ensure that:

  • Alice can read, write and execute files
  • Bob can read and execute files, but cannot write to them
  • Mallory can neither read, write or execute files

To complete this, you will need to use group membership.

Commands Required: Square brackets indicate optional fields. Keep in mind that some of these commands may require [sudo].

sudo
ls [-l]
useradd
userdel
groupadd
adduser [bob] [awesomegroup]
deluser [bob] [awesomegroup]
less /etc/passwd
less /etc/group
delgroup
chmod
chown
chgrp
rm
mkdir
touch
su [alice] [bob] [mallory] -s /bin/bash
whoami

Make sure you check the permissions from the perspective of the user you created. That is, you must login as that user.

When you are finished, recursively delete the folder and all files within.