Type of Users:
Root user - Default
user highly privileged UID is 0. This will create while installing the
operating system
System users - is nothing
but services, at the time of installing particular package. UID starts from 1
to 499.
Local users - after
installing of the operating system admin user will create these users. UID
starts from 500 to 65534.
Ø After creating a user, user
home directory will be created in default path /home.
Ø One group is will be created
with same user name (primary group)
Ø Files from /etc/skel will be
copied automatically to user home directory
Ø /etc/passwd file is updated
with user information
Ø /etc/group file is update with
primary group information
Important
files
/etc/passwd
User Information
/etc/shadow
User Passwords
/etc/group
Group Information
/etc/gshadow
Group Passwords
User Administration Commands:
# useradd
<user name> - To create specified local user
# useradd –d <home
directory> <user name> - create
a user with specified home path
[root@sankar ~]# useradd -d /users/ san
[root@sankar ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
# useradd
–u <UID> <user name> -
create user with specific UID.
# passwd
<user name> - change the user password
# userdel
<user name> - delete user
# userdel
<user name> - delete user including home directory
# finger
<user name> - See user properties
# chfn <user name> - Change
user information[root@sankar ~]# chfn root
Changing finger information for root.
Name [root]:
# chage –l <user name> - to check user password expiry and account expiry information
chage -l root
Last password change : May 02, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
# su -
<user name> - Switch to
other user account
# id
<user name> - it will show the user id
[root@sankar ~]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys), 6(disk),10(wheel)
[root@sankar ~]#
#
system-config-users - create and manage user account in GUI
Usermod command options:
-c = We
can add comment field for the user account.
-d = To
modify the directory for any existing user account.
-e =
Using this option we can make the account expiry in specific period.
-g =
Change the primary group for a User.
-G = To
add a supplementary groups.
-a = To
add anyone of the group to a secondary group.
-l = To
change the login name from tecmint to tecmint_admin.
-L = To
lock the user account. This will lock the password so we can’t use the account.
-m =
moving the contents of the home directory from existing home dir to new dir.
-p = To
Use un-encrypted password for the new password. (NOT Secured).
-s =
Create a Specified shell for new accounts.
-u = Used
to Assigned UID for the user account between 0 to 999.
-U = To
unlock the user accounts. This will remove the password lock and allow us to
use the user account.
Creating Groups:
Group
information is located/stored on /etc/group file.
# groupadd
<group name> - Create a
group with specified name
# usermod
–G <group name> <user name> - Add user to group
# gpasswd
–a san Administrators – Adds the user ravi to the group Administrators
# gpasswd
–A san Administrators – give user ravi administrative rights to the group
# gpasswd
–d san Administrators – remove user ravi from the group Administrators
# groupdel
<group name> - Delete group name
#
groupmod –n <new group name> <old group name> - change group name
# newgrp
- <group name> - Login into the group if successful, re-initializes the
user environment
No comments:
Post a Comment