Difference between revisions of "User Account Management Debian 11"
Jump to navigation
Jump to search
(I added bullet points) |
(added more things) |
||
| Line 1: | Line 1: | ||
| − | + | === Common Commands For User Account Management === | |
| + | * <code>adduser <username></code> : Adds a user | ||
| − | * | + | * <code>sudo userdel <username></code> : Removes a user |
| − | * | + | * <code>sudo addgroup <groupname></code> : Adds a group |
| − | * | + | * <code>sudo delgroup <groupname></code> : Removes a group |
| − | * | + | * <code>sudo usermod -aG <groupname> <username></code> : Adds a user to a group |
| − | * | + | * <code>sudo gpasswd -d <username> <groupname></code> : Removes a user from a group |
| − | + | === Usermod === | |
| + | Used to modify users, has many options/flags. | ||
| − | + | Basic format: <code>sudo usermod <options> <username></code> | |
| + | |||
| + | # -c = Add comment field for the useraccount. | ||
| + | # -d = To modify the directory for any existing user account. | ||
| + | # -e = Using this option we can make the account expiry in specific period. | ||
| + | # -g = Change the primary group for a User. | ||
| + | # -G = To add a supplementary groups. | ||
| + | # -a = To add anyone of the group to a secondary group. | ||
| + | # -l = To change the login name from tecmint to tecmint_admin. | ||
| + | # -L = To lock the user account. This will lock the password so we can’t use the account. | ||
| + | # -m = moving the contents of the home directory from existing home dir to new dir. | ||
| + | # -p = To Use un-encrypted password for the new password. (NOT Secured). | ||
| + | # -s = Create a Specified shell for new accounts. | ||
| + | # -u = Used to Assigned UID for the user account between 0 to 999. | ||
| + | # -U = To unlock the user accounts. This will remove the password lock and allow us to use the user account. | ||
Latest revision as of 22:43, 9 November 2023
Common Commands For User Account Management[edit | edit source]
adduser <username>: Adds a user
sudo userdel <username>: Removes a user
sudo addgroup <groupname>: Adds a group
sudo delgroup <groupname>: Removes a group
sudo usermod -aG <groupname> <username>: Adds a user to a group
sudo gpasswd -d <username> <groupname>: Removes a user from a group
Usermod[edit | edit source]
Used to modify users, has many options/flags.
Basic format: sudo usermod <options> <username>
- -c = Add comment field for the useraccount.
- -d = To modify the directory for any existing user account.
- -e = Using this option we can make the account expiry in specific period.
- -g = Change the primary group for a User.
- -G = To add a supplementary groups.
- -a = To add anyone of the group to a secondary group.
- -l = To change the login name from tecmint to tecmint_admin.
- -L = To lock the user account. This will lock the password so we can’t use the account.
- -m = moving the contents of the home directory from existing home dir to new dir.
- -p = To Use un-encrypted password for the new password. (NOT Secured).
- -s = Create a Specified shell for new accounts.
- -u = Used to Assigned UID for the user account between 0 to 999.
- -U = To unlock the user accounts. This will remove the password lock and allow us to use the user account.