Showing posts with label Add User. Show all posts
Showing posts with label Add User. Show all posts

Manage User and Group

From here we discuss some basic commands which used for basic administartion of User & Group in a Server.

#w Login deatils + on which terminal.
#pwd To know present working directory.
#uname To print system information.
#man {command name} A man page (manual page) is a form of software documentation usually found on a Unix-like operating system. 

Add User:
#adduser {new username}
Root user's USER ID will always '0'. Other created users USER ID always above '1000'.

The user deatils will write in /etc/passwd, user can see the file by #cat /etc/passwd

Home folder for the user will be /home/{username} and there will be 3 hidden file will be created
.profile .bashrc .logout

#chfn {username} To edit user details.
#passwd {username} To change password of user name.
#useradd -G {group name} {user name} To add a user to a group.

Add Group
Every user is part of a group, a administrator can change group of a user and also can set or permission to a group so it will automatically set for users in that group.

#groupadd {group name}
Root user's GROUP ID will always '0'. Other created users GROUP ID always above '1000'.

#usermod -G {group name} {username} to add a user to group.
#id -nG {group name} to view the users in group.
#groupdel {group name} to delete a group.
#groupmod -n {new group name} {old group name} To change group name. 
#chgrp {new group} {file name} -R Changes the group that has access to a file or directory.