The document discusses user account management in Linux. It demonstrates how to use commands like useradd to create users, usermod to modify users, and userdel to delete users. It shows examples of creating users with default settings, custom user IDs, home directories, comments, and shells. It also demonstrates modifying user IDs, home directories, and deleting user accounts along with their home directories.
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 ratings0% found this document useful (0 votes)
26 views4 pages
3.user Management
The document discusses user account management in Linux. It demonstrates how to use commands like useradd to create users, usermod to modify users, and userdel to delete users. It shows examples of creating users with default settings, custom user IDs, home directories, comments, and shells. It also demonstrates modifying user IDs, home directories, and deleting user accounts along with their home directories.
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/ 4
23
Module 2: User Management
User Management Commands
useradd To create user account usermod To modify user account userdel To delete user account id To display id of a user tail -5 To display bottom 5 lines of a file grep To display a sleeted line in a file
“useradd” Command Options
useradd To create user account with defaults -u use id (UID) -d To create user account with specific user home Directory -g Primary Group Name or GID -o Override -G Secondary Group -c Comment -s Shell
Modifying Home Directory for user “baba” form “/home TO /hwdept”
[root@localhost ~]# mkdir /hwdept
[root@localhost ~]# [root@localhost ~]# grep baba /etc/passwd baba:x:2003:2003::/home/baba:/bin/csh [root@localhost ~]# usermod -d /hwdept/baba baba [root@localhost ~]# [root@localhost ~]# grep baba /etc/passwd baba:x:2003:2003::/hwdept/baba:/bin/csh [root@localhost ~]# 6 Deleting user “venkat” along with “home directory” also
[root@localhost ~]# userdel -r venkat
[root@localhost ~]# ls /home baba gayatri kumar sai [root@localhost ~]#
NOTE : This command will delete “user” along with “Home directory” also
Deleting “sairaj” user account :
[root@localhost ~]# ls /home
baba gayatri kumar sai sairaj venkat [root@localhost ~]# [root@localhost ~]# userdel sairaj [root@localhost ~]# [root@localhost ~]# ls /home baba gayatri kumar sai sairaj venkat [root@localhost ~]# [root@localhost ~]# rm -r –f sairaj
NOTE : Manually you have to Delete “sairaj” home directory
A user is an entity, in a Linux operating system, that can manipulate files
and perform several other operations. Each user is assigned an ID that is unique for each user in the operating system
structured my explanation of account administration like this:
What three things must you do to manage user accounts?