Slide 1 : LINUX KOLLA SANJEEVA RAO MCA
Users & Group Administration : Users & Group Administration
USER : USER User is an account to access the system resources.
Types of users : Types of users Administrative/ Root user Account
Normal & Regular user
System Account
Administrative/ Root user Account : Administrative/ Root user Account This A/C is created automatically while installing the OS.
This users will have more privileges on resources.
Normal & Regular User : Normal & Regular User This account is created by Root user.
This user will have necessary privileges to perform some regular task.
System Account : System Account These are the service accounts for different server configuration.
System Account : System Account 0-99 system a/c created by O/S.
100-499 Users can enforcedly make the system accounts.
Multi-user & Multi tasking : Multi-user & Multi tasking Unix/Linux is multi user and multi tasking OS
User Private Group (UPG) : User Private Group (UPG) Redhat Linux uses User Private Group (UPG) Scheme :-
- User always get created with primary group.
-One Primary Group per User
When a user is created in Linux : When a user is created in Linux When a user is created in Linux automatically system will create three things.
1.Home directory ( /home/username)
2.Mail account
(/var/spool/mail/username)
3.Unique UID & GID
Data Base files : Data Base files Database Files used in User&Group Adminstration
/etc/passwd
/etc/shadow
/etc/group
/etc/passwd - Database file of users : /etc/passwd - Database file of users 1.The /etc/passwd file is the standard linux database for user accounts.
2. Every user on the system will have a single one line entry in the /etc/passwd.
: 1. This file contains the encrypted user passwords assigned by the password binary file
2. Password s are encrypted through DES (Data Encryption Standard ) or MD5 (Message Digest Ver. 5) Algorithm /etc/shadow
/etc/shadow : /etc/shadow
/etc/group : /etc/group This file contains group name and GID of the groups
User Creation : User Creation Options :
-u - UID
-g - Primary group name/ GID
-o - Override
-G - Secondary group
-c - Comment
-d - Home directory
-s - Shell Creating a User
[root@comp1 ~]#useradd
User Modification : User Modification Options :
-l - Change login name
-L - Lock the account
-U - Unlock the account Modifying a User
[root@comp1 ~]#usermod
User Deletion : User Deletion -r - recursively Deleting a User
[root@comp1 ~]#userdel
Group Creation : Group Creation Options :
-g - GID
-o - override Creating a Group
[root@comp1 ~]#groupadd
Group Modification : Group Modification Options :
-g - GID
-o - Override
-n - To change the group name Modifying a Group
[root@comp1 ~]#groupmod
Group Deletion : Group Deletion Deleting a Group
[root@comp1 ~]#groupdel
Changing user setting : Changing user setting Changing User setting
[root@comp1 ~]#chage
Group setting : Group setting -a - add a user
-d - Delete a user from group
-M - Creating multiple members Group setting
[root@comp1 ~]#gpasswd
Commands for User & Group : Commands for User & Group useradd
usermod
Userdell
groupadd
groupmod
groupdel
Chwon
Commands for User & Group : Commands for User & Group (viii) chgrp
Chmod
gpasswd
passwd
chage
finger
chfn
LAB # 2( User& Group Administration) : LAB # 2( User& Group Administration) 1. Creating a user
# useradd u1
2.To set Password for u1
# passswd u1
3.How to confirm the creation of user?
# vi /etc/passwd
4.If you want to change user ID?
# useradd –u 700 u1
( Group-id will be changed automatically)
5.How to change group-ID?
# useradd –g 501 u2
LAB# 2( User& Group Administration) : LAB# 2( User& Group Administration) 6.How to override user-id?
# useradd –u 701 -0 u3 (701 is already existing user-id)
7. How to add the user as a member of the secondary group?
# groupadd lgs
# useradd –G lgs l1
# Vi /etc/group
8.How to change the home directory?
# mkdir /mkt
# useadd –d /mkt/m1 m1
9.How to change shell?
# useadd –s/bin/tcsh m2
Master Useradd command : Master Useradd command
LAB 2( User& Group Administration) : LAB 2( User& Group Administration) 10.How to change login-name?
# usermod –l user1 u1 (u1 is old name and user1 is new name)
11.How to Lock the Password?
# usermod –L user1
12. How to UnLock the password?
# usermod –U user1
13. How to delete a user?
# userdel user1
14. To confirm weather the user is deleted or not?
# vi /etc/passwd
LAB 2( User& Group Administration) : LAB 2( User& Group Administration) 15.How to create a group?
#groupadd group1
16.How to confirm the group creation?
#vi /etc/group
16.How to allot our own GID to a group?
#groupadd –g 950 group2.
17.What is the use of override option ?
# groupmod –g 950 -0 group3.
18. How to change the Group name?
# groupmod –n
19. How to delete a group?
# groupdel group2 group3 950
LAB 2( User& Group Administration) : LAB 2( User& Group Administration) 20.How to add the users as a members of the Group?
Implimentation
# groupadd linuxg
# usreradd l1
# useradd l2
# useradd l3
# gpasswd –a l1 linuxg
# vi /etc/group
# gpasswd –M l2,l3 linuxg
21. Deleting a User From a group?
# gpasswd – d l2 linuxg l1
l2
l3 l1 l2 l3 users Linux Group
LAB 2( User& Group Administration) : LAB 2( User& Group Administration) 22.How to make one user as a administrator of the groupers as a members of the Group?
# gpasswd –A l3 linuxg l1
l2
l3 l1 l2 l3 users Linux Group Designated as Administrator
LAB 2( User& Group Administration) : LAB 2( User& Group Administration) 23.How to change the password age?
# Chage l1
Minimum password Age :[ ]
Maximum password age:[]
Last password Change:
Password Expiry :
24.What is use of the command FINGER?
# Finger l2
it displays the user information.
login
Directory
Never logedin
Mail etc
25.How to change t he FINGER information?
# Chfn l2
Shell : Shell Default shell in Linux is bash.
Bash-Bourne again shell [root @ localhost ~] # shell User name Host or computer name Root user logged in Current working Directory
/root
Shell : Shell Shell looks as follows if normal user is logged –in [u1 @ localhost ~] $ shell User name Host or computer name Normal user logged in Current working Directory
/home/u1
Types of shells : Types of shells /bin/sh
/bin/bash
/sbin/nologin
/bin/ash
/bin/bsh
/bin/ksh
/bin/tcsh
/bin/csh
Tele terminals (Virtual Console) : Tele terminals (Virtual Console) There are 07 tty present in Linux.
tty1 CTRl+Alt+F1
tty2 CTRl+Alt+F2
tty3 CTRl+Alt+F3
tty4 CTRl+Alt+F4
tty5 CTRl+Alt+F5
tty6 CTRl+Alt+F6
tty7 CTRl+Alt+F7 Text Based Graphical