0% found this document useful (0 votes)
8 views5 pages

Lab 3

The document outlines tasks for a graded lab on creating users and groups, setting file permissions, and switching between user accounts. It includes instructions to: 1) Create 3 user accounts and 2 groups, adding the users to groups; check the UID and GID. 2) Create 3 files and set specific permission values using chmod. 3) Create user accounts test1 and test2, log in as each, copy a file as test1 and change its owner and permissions, and test executing it from each account.

Uploaded by

Sadia Naseer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Lab 3

The document outlines tasks for a graded lab on creating users and groups, setting file permissions, and switching between user accounts. It includes instructions to: 1) Create 3 user accounts and 2 groups, adding the users to groups; check the UID and GID. 2) Create 3 files and set specific permission values using chmod. 3) Create user accounts test1 and test2, log in as each, copy a file as test1 and change its owner and permissions, and test executing it from each account.

Uploaded by

Sadia Naseer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab# 03:

Graded lab tasks:


Creating Users and Groups

 Create 3 user accounts (user1, user2, user3) and add 2groups (gr1, gr2).
add user1 to gr1 and add user2 to gr2.
 Check user ID (UID) and group ID (GID) by listing file /etc/passwd. Find lines
with added user. What is the UID and GID for these accounts?
Permissions

 Create 3 files with touch command: file1, file2, file3.


 Write the command line by using letters with chmod to set the following
permissions: rwxrwxr-x for file1 r-x—x—x for file2 ——xrwx for file3
 Write the command line by using numbers with chmod to set the following
permissions: -w for file4 (you have to prepare this file) rwx--x—x for folder1
(you have to prepare this folder)

Switching User

 Create two user accounts: test1 and test2


 Logging in id: test1 (group users, with bash shell, home directory
/home/test1 )
 Logging in id: test2 (group public, with bash shell, home directory
home/test2 )
 For the two accounts set a password.
 Logging in as test1 and copy /bin/ls into test1 home directory as “myls” file.
 Change the owner of myls totest1 and the permissions to 0710. What does
this permission value mean? Logging in as test2 and try to use
/home/test1/myls to list your current directory. Does it work?
 Create a new group lab3 with test1 and test2. Change the owner group of
myls file to lab3. Try again from test2 account to execute /home/test1/myls
to list your current directory. Does it work?

You might also like