User and group management
user and group managment:-
*************************
user --> the pernson who is using the perticular machine
group: -> the collection of users is calles as group
user management:
****************
-> users have there own UID for the kernel and username is for our referance
-> UID from 1 to 999 is applied for default users.
-> the users we create are started with UID 1000 +
-> the complete user details are stored in /etc/passwd file
-> the password related details are stored under /etc/shadow file
#vim /etc/passwd
<username>:<pointer to password>:<UID>:<primary group ID>:<description>:<home directory>:<shell path>
ex: root:x:0:0:root:/root:/bin/bash
#vim /etc/shadow
<username>: <encrypted password>: <password aging>
root: bcslsdbbvjksd c dbdjkvjwdnvv d cm: 99999: 7:
creating a user:
*****************
#useradd <username> --> to create default user
ex: #useradd fed
#vim /etc/passwd --> go to last line and verify
#cat /etc/passwd --> you can the data on screen
#getent passwd <username> --> to get the user info of perrticular user
eX: #getent passwd fed
setting a password for user:-
****************************
#passwd <username>
ex: #passwd fed
new password: ----
confirm password: ----
group management:-
*****************
-> all group details are stored in /etc/group file
-> group have there own GID which are for kernel referance & group name is for our referance
#vim /etc/group
<group name> : <pointer to password> : <group ID> : <group members>
ex: root : x : 0 :
# vim /etc/gshadow
<group name> : <encrypted password> : <<group admin> : <group members>
root: ---------: zafar: zaf,pragthi
creating a group:-
****************
#groupadd <group name>
ex: #groupadd ka
#vim /etc/group --> go to last and verify
#cat /etc/group --> to show the complete details of group file on screen
#getent group <group name> --> to show the entry of perticular group
ex: #getent group ka
create a group with custom GID:-
*******************************
#groupadd -g <group id> <group name>
ex: #groupadd -g 25000 csk
#getent group csk
-> types of groups:
********************
1) primary group --> the group created while creating a perticular user is called as primary.
2) secondary group --> for one perticcular user groups other than primary group which he is present are called as secondary group
setting a password:-
*******************
#gpasswd <group name>
ex: #gpasswd ka
new password: -----
confirm password: -----
#vim /etc/gshadow --> to verify
modifing the groups created:-
*****************************
#groupmod -n <new group name> <old group name> --> to change the group name
ex: #groupmod -n karnataka ka
#getent group ka --> to details
#getent group karnataka ---> to know the deatails of that perticular group
#groupmod -g <custom group ID> <group name> --> to chnage the group ID of existing group
ex: #group -g 22500 karnataka
#getent group karnataka
Comments
Post a Comment