This document describes the basic commands for User- and Group Management.
User Management
View existing users |
|
Check if an user exist |
|
User passwords and password expiry information is stored in: |
|
Create a new user |
|
Setup password for a user |
|
Remove User Account |
|
Remove the user’s home directory |
|
Rename user name |
|
Change user’s ID |
|
Change User’s Home Directory
Change Home Directory for new users The default home directory for new users is defined by HOME variable in /etc/default/useradd |
|
Change Home Directory for existing users |
|
Group Management
User group information is stored in |
|
Add a new user to primary group |
|
Add a new user to secondary group |
|
Find out users group identity |
|
Add an existing user to secondary group |
|
Change users primary group |
|
Check if a group exists) |
|
Add a group |
|
Delete a group |
|
View users’ group membeship |
|
Add user to multiple groups |
|
Remove user from a group by entering the groups to be preserved. If the user is currently a member of a group which is not listed, the user will be removed from the group. |
|
Change file/folder owner/group
Change files ownership to a user |
|
Change files ownership to a user on files and directories recursively |
|
Change files ownership to a group |
|
To setup a file readable/executable by everyone and writable by the owner only |
|
change permissions for all files and directories within a directory |
|
Delegate Permissions
Edit sudo config file |
|
If you run the command vi /etc/sudoers Sudoers file is read-only! To save and quit the sudoers file. |
|
Append rights |
Where,
|
Allow a user to sudo, sudo allows a user to temporarily take on the role as root. |
|