In: Computer Science
USING COMMAND PROMPT ON LINUX. show how...
Linux Users, Groups, and Permissions Lab
Objective:
Understand how to create user accounts
Understand how to create group accounts
Creating good password policies
Understanding permissions and file sharing
Setup:
You will need a Ubuntu Server VM
Walk Through:
You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users: i.e. Super Hero’s and Villains, Harry Potter Characters, or other interests of yours.
Create 2 groups:
One for the Protagonists
One for the Antagonists
Create 5 users:
2 Protagonists
2 Antagonists
1 Neutral – Can access both group's files
User Configuration:
Each user will have their own home directory that only they can
access.
Users must change their password when they first log in.
Users are required to change their password after 6 months.
Required Directories in /home:
1. Share – Anyone can access this directory to add or remove
2. Protagonists – Only the protagonists group can add or
remove
3. Antagonists – Only the antagonists group can add or remove
***Directory names can be named based on your current theme***
Ensure that you test that each account is working by either switching users, or logging in as different users.
What to Submit:
Submit a lab report documenting your process.
Make sure to include:
Initially for better results you need to modify /etc/adduser.conf . It will be applicable on all the accounts that you configure.onf file.The changes you make in this file will be applicable on all the accounts that will be created now. Type in the following command to access /etc/adduser.conf.In case you are not in the root mode switch to root mode by running command sudo -s. In case you are not able to see the terminal in ubuntu press CTRL+ALT+T.
In this file you need to change DIR_MODE=700 in order so that only perticular user has access to his directory.
$ cat /etc/adduser.conf | grep -v "^#" | grep -v "^$"
DSHELL=/bin/bash
DHOME=/home
GROUPHOMES=no
LETTERHOMES=no
SKEL=/etc/skel
FIRST_SYSTEM_UID=100
LAST_SYSTEM_UID=999
FIRST_SYSTEM_GID=100
LAST_SYSTEM_GID=999
FIRST_UID=1000
LAST_UID=29999
FIRST_GID=1000
LAST_GID=29999
USERGROUPS=yes
USERS_GID=100
DIR_MODE=0755 change this to 700
SETGID_HOME=no
QUOTAUSER=""
SKEL_IGNORE_REGEX="dpkg-(old|new|dist|save)"
After this you need to remain in the root mode and create 5 users by the following command
$ sudo adduser katniss Adding user `Katniss` (1001) ... Adding new user `katniss' (1001) with group `protagonist' ... Creating home directory `/home/Ka'tniss ... Copying files from `/etc/skel' … Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for Katniss Enter the new value, or press ENTER for the default Full Name []: katniss katniss Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] Y
Similarly you can create 4 users one i have already created for protagonist
in order that user must change their password at next login you must run the command
$ sudo chage -d 0 Katniss
you can set the limit of 6 months for password change by using following command
chage -m 180 katniss
first you need to create group like protagonist. To do this run the command
sudo groupadd protagonist
To add user account to a group . Run the command
usermod -a -G protagonist katniss