You are on page 1of 6

FP501 Open Source Operating System

LAB 4: Configuring Users,


Group and Permission using
Command Line and GUI
Duration

: 2 Hours

Learning Outcomes
By the end of this lab, students should be able to:
1. Add users, group and set permission using command line and GUI

Activity 4A
Activity Outcome: configure user, group and set permission using command line

Procedure :
NUM
1

INSTRUCTION
Create 3 new users - user001,
user002, user003

COMMAND LINE
useradd user001
useradd user002
useradd user003

Create new group group001,


group002
Create new directory folder1
Enter into folder1 directory
Create new file - data
Determine the permission of
file data
Change the permission of file
data to all can read, all can
write and all can execute
Change the owner of the data
to user001

groupadd group001
groupadd group002
mkdir folder1
cd folder1
touch data
ls l

Change the group of the data


to group002
Write down the output
change the group of user 001
so user001 can be in group002
Write down the output

sudo chgrp group002 data

3
4
5
6
7
8
9
10

chmod 777 data


chown user001 data

#usermod G group002 user001

1 | 34

FP501 Open Source Operating System

Activity 4B
Activity Outcome: Configure user, group and set permission using GUI

Procedure
Step 1 : Adding a User to an Ubuntu Linux System
There are two methods for adding new users to a system, one way is using the graphical
User settings tool and the other is to use the adduser command-line tool. In this section
we will look at both approaches.
1.

To add a new user to your Ubuntu Linux system using the User settings tool
select System desktop menu and choose Users and Groups from the Administration
sub-menu. A dialog similar to the one shown below will appear:

2.

By default, access to user and group settings is locked to prevent unauthorized


modification. To unlock access, click on the Unlock button, select an appropriate user
name and enter the corresponding password. To subsequently add a new user, click on
the Add User button. The New user account dialog will appear ready to be filled in with
data relating to the new user, such as user name, real name, password and contact
information:

2 | 34

FP501 Open Source Operating System

3.

To define the privileges for this new user select the Privileges tab of the New
user account dialog to display the privileges screen:

3 | 34

FP501 Open Source Operating System


4.

De-select any privileges you do not wish the new user to have. In particular you
will want to ensure the user does not have Administration privilege unless the user is a
trusted system administrator. To disable administration privileges, ensure that the
Administer the system option is deselected (the default setting). The other privileges are
usually considered to be safe for the typical user.

5.

The final screen on the Add user dialog allows Advanced settings to be defined.
These include such issues as the home directory of the user (traditionally
/home/username), the type of shell that is presented as the command line in a terminal
window (Bash is usually the default and there is no reason to change this unless you
specifically need a different shell), the group to which the user belongs and the user ID.
Use the drop down group menu to change the user's group membership to a different
group:

6.

Once the new user is configured, click on the OK button to add the new user.
Once added the new user should appear in the list of users in the settings dialog and it
should be possible to login in using the username and password specified.

4 | 34

FP501 Open Source Operating System

Questions:
1.

Write down the output in step 6 from Activity 4A

(2 marks)

2.

Write down the output in step 7 from Activity 4A

(2 marks)

3.

Write down the output in step 8 from Activity 4A

(2 marks)

4.

Write down the output in step 9 from Activity 4A

(2 marks)

5.

Add a new user named MrRight

( 2 marks)

5 | 34

FP501 Open Source Operating System

6.

Set the password as 1234

(2 marks)

7.

Check all the privileges in user privileges


(2 marks)
________________________________________________________________

8.

Add MrRight into a group named GroupMrRight


(2 marks)
________________________________________________________________

9.

Add MrRight into a another group named GroupMrRight2


(2 marks)
________________________________________________________________

6 | 34

You might also like