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

Lab - Ganesh Ram

This document contains solutions to several Linux lab tasks involving user and group management, file permissions, and file operations. The tasks include adding new users and groups, modifying user and group attributes, setting file and folder permissions, moving files between folders, and viewing password files. The solutions demonstrate commands like useradd, groupadd, chown, chmod, mkdir, mv, and cat to accomplish the tasks.

Uploaded by

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

Lab - Ganesh Ram

This document contains solutions to several Linux lab tasks involving user and group management, file permissions, and file operations. The tasks include adding new users and groups, modifying user and group attributes, setting file and folder permissions, moving files between folders, and viewing password files. The solutions demonstrate commands like useradd, groupadd, chown, chmod, mkdir, mv, and cat to accomplish the tasks.

Uploaded by

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

Mare ganessh ram

CSTI3 2K22CSUNO1239

Lab task 1

1. Add new users (Sam and Mark) and groups (Sales and IT). Assign passwords to the new
users. Check the entries of the newly added users and groups in their respec ve files
(/etc/passwd and /etc/group).

Solu on:

Sudo useradd sam

Sudo useradd mark


2. Add user Sam to the Sales group and user Mark to the IT group.

Solu on:

Sudo usermod -aG IT sales sam

3. Iden fy Sam’s group membership.

Solu on:

group sam

4. Delete both the user account Sam and the Sales group.

Solu on:

Sudo userdel sam

Sudo groupdel sales

Lab task 2 A

1. Create two files named DT and PT inside a folder “Data”.

Solu on:

mkdir Data

touch Data/DT

touch Data/PT
2. You need to ensure that the owner of the Data folder should be root user Only.

Sol.

u on:

Sudo mkdir Data

Sudo chown root:root Data

Lab task 2 B:

1. Create a folder “Sale” to any local user.

Solu on

Sudo useradd -m john /home/john/sales

Sudo mkdir

Sudo chown john

2. Set a specific permission ONLY to the folder

Solu on:

Sudo chmod 750 /home/john/sales


3. The permission is – read(user), read, write, execute (group) and execute(other).

Solu on:

Sudo chmod 764 /home/john/sales

Lab task 3 A

1. Create four files simultaneously with the name – d, dd, ddd, dddd.

Solu on:

touch d dd ddd dddd

2. Move two files (d, dd) into a folder called “DevOPS”.

Solu on:

mkdir DevOPS

mv d dd DevOPS

3. Move the remaining two files into another folder called “TesƟng”.

Solu on:

mkdir Tes ng

mv ddd dddd Tes ng

Lab task 3 B

1. Create a user “Smith”

Solu on:
Sudo useradd smith

2. Set a password “Any123456”

Solu on:

Sudo passed smith

3. Shows both files where passwords saved in the system.

Solu on:

Sudo cat /etc/shadow

You might also like