Commands for Managing Users
1. useradd – Create a new user or update default new user information
Example :
[root@myserver ~]# useradd admin
2. passwd – Used to change the user passwd
Example :
[root@myserver ~]# passwd admin
Changing password for user admin.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
(For full details – Refer User Creation Article)
3. userpasswd – A graphical tool to allow users to change their passwords.
Example :
[root@myserver ~]# userpasswd (display one GUI window for changing password)
4. userdel – Delete a user account and related files
Example :
[root@myserver ~]# userdel -r admin
[root@myserver ~]#
The -r option
All user details will be removed from /etc/passwd , /etc/group and /etc/shadow .
5. userinfo – A graphical equivilient to chfn.
Example :
[root@myserver ~]# userinfo
6. usermod – Modify a user account
Example :
i) Changing User home directory
usermod -d /usr/antony
ii) Changing user shell
usermod -s /bin/csh
iii) Setting user expiry date (Date format : YYYY/MM/DD)
usermod -e 2007/09/30
7. usernetctl – allow a user to manipulate a network interface if permitted
Example :
[root@myserver ~]# usernetctl
usage: usernetctl
[root@myserver ~]# usernetctl eth0 report
[root@myserver ~]# usernetctl eth0 up
[root@myserver ~]#
8. users – print the user names of users currently logged in to the current host
Example :
[root@myserver ~]# users
root raj exam1
[root@myserver ~]#
