0% found this document useful (0 votes)
35 views7 pages

Practical No. Aim: Working With Users, Group and Permissions. 1) Useraddcommand To Create A New User

This document discusses Linux user and group permissions. It covers: 1) Creating a new user and granting superuser privileges to a user named "smith". 2) Temporarily changing identities using the "su" command for root and other local users. 3) Administrative commands like useradd, chage, passwd, and chsh to manage users. 4) Group management commands like groupadd and gpasswd. 5) File permissions using symbolic modes, operators like +, -, = and binary/numeric modes.

Uploaded by

7303510215
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)
35 views7 pages

Practical No. Aim: Working With Users, Group and Permissions. 1) Useraddcommand To Create A New User

This document discusses Linux user and group permissions. It covers: 1) Creating a new user and granting superuser privileges to a user named "smith". 2) Temporarily changing identities using the "su" command for root and other local users. 3) Administrative commands like useradd, chage, passwd, and chsh to manage users. 4) Group management commands like groupadd and gpasswd. 5) File permissions using symbolic modes, operators like +, -, = and binary/numeric modes.

Uploaded by

7303510215
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/ 7

Practical No.

Aim: Working with Users,Group and permissions.


1) useraddcommand to create a new user

2) Create a user account to grant him the privilege of super user, as shown below:

3) Open the file /etc/sudoers and the following lines for smith:
Jagdish ALL = (ALL) ALL It is as shown below:
4) Run the command visudo:
#visudo
(5) Test the configuration by making smith to login and perform any administrative activity as shown
below:
(i) Add user Mayuresh using sudo:

(ii) Changing password of Mayuresh using sudo:

(B) Temporarily changing identity with the help of su command:


(1) When root changes identity temporarily, with the help of su command, the system never asks for
password:

(2) But when any local user tries to change the identity temporarily, redhatsystem asks for the password
as shown below:

(C) Administrative Commands:


(1) useradd command with its options:

The file / etc/passwd also shows the entry of the user asfollow:

2) chagecommand to change the age of user’s password :

The above command also affects the file /etc/shadow asfollows:


3) passwdcommand to lock or unlock user’s password:

4) chshcommand to change the shell of user:

5) Groupaddcommand to create a new group and gpasswd command to add members and
administrator in the group:

The above command also affect the file /etc/group asshown:


D) File Permission
1) Using symbolic mode
i)u- owner
ii)g-group
iii)o-others
Permission types
i)r-read
ii)w-write
iii)x-execute
Here you can see the directory test has the permission for ownerrwx ,for group owner has the
permission rx and for others rx.

1) To add permission
‘+’ operator is used to add a permission on file as follows:
1) # Chmodg+wcommand is used to add write permission group owner
2) To remove permission
‘-’ operator is used to remove permission of files.
#Chmod u-x command will remove the execute permission of owner of test directory

3) To replace permission
‘=’ operator is used to replace the permission by old permission.
# Chmod o=rwcommand will replace the permission of others users byrwof abc.txt file.

2) binary reference and numeric mode

i)Read-4
ii)Write-2
iii) Execute-1

7=4+2+1 read+write+execute
5=4+1 read+execute
0 No permission
Chmod 750 command is used to give permission to owner as read,write and execute for group
owner as read and execute and for others no permission .

Chmod 754 command is used to give permission to owner as read,write and execute for group
owner as read and execute and for others read permission .
7=4+2+1 read+write+execute
5=4+1 read+execute
4 read

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy