Wednesday, June 26, 2013

Linux command for username and group

Change or rename user name and UID (user-id)
# usermod -l <new_username> <old_username>
# usermod -u UID <username>

List username from a group
# getent group <groupname>

Remove username from a group
# gpasswd -d <username> <group>

Remove/Delete a user account
# userdel <username>
The following command will also remove user home directory
# userdel -r <username>

Add user to a group
# adduser <username> <group>

No comments:

Post a Comment