All parameters options for users and groups managing commands in Ubuntu
Ubuntu is a multi-user operating system. This means that more than one user can be actively logged and using the system at any one time. Obviously, it makes sense for each user to have their own user account and home directory, and for different users to have different privileges.
The commands used here are: "useradd, usermod, userdel, groupadd, groupmod, groupdel".
Useradd
Usage: useradd [options] LOGIN
Options:
| -b, --base-dir BASE_DIR | base directory for the new user account home directory |
| -c, --comment COMMENT | set the GECOS field for the new user account |
| -D, --defaults | print or save modified default useradd configuration |
| -e, --expiredate EXPIRE_DATE | set account expiration date to EXPIRE_DATE |
| -f, --inactive INACTIVE | set password inactive after expiration to INACTIVE |
| -g, --gid GROUP | force use GROUP for the new user account |
| -G, --groups GROUPS | list of supplementary groups for the new user account |
| -h, --help | display this help message and exit |
| -k, --skel SKEL_DIR | specify an alternative skel directory |
| -K, --key KEY=VALUE | overrides /etc/login.defs defaults |
| -l, --no-log-init | do not add the user to the lastlog and faillog databases |
| -m, --create-home | create home directory for the new user account |
| -M, --no-create-home | do not create users home directory (overrides /etc/login.defs) |
| -N, --no-user-group | do not create a group with the same name as the user |
| -o, --non-unique | allow create user with duplicate (non-unique) UID |
| -p, --password PASSWORD | use encrypted password for the new user account |
| -r, --system | create a system account |
| -s, --shell SHELL | the login shell for the new user account |
| -u, --uid UID | force use the UID for the new user account |
| -U, --user-group | create a group with the same name as the user |
| -Z, --selinux-user SEUSER | use a specific SEUSER for the SELinux user mapping |
Usermod
Usage: usermod [options] LOGIN
Options:
| -c, --comment COMMENT | new value of the GECOS field |
| -d, --home HOME_DIR | new home directory for the user account |
| -e, --expiredate EXPIRE_DATE | set account expiration date to EXPIRE_DATE |
| -f, --inactive INACTIVE | set password inactive after expiration to INACTIVE |
| -g, --gid GROUP | force use GROUP as new primary group |
| -G, --groups GROUPS | new list of supplementary GROUPS |
| -a, --append | append the user to the supplemental GROUPS mentioned by the -G option without removing him/her from other groups |
| -h, --help | display this help message and exit |
| -l, --login NEW_LOGIN | new value of the login name |
| -L, --lock | lock the user account |
| -m, --move-home | move contents of the home directory to the new location (use only with -d) |
| -o, --non-unique | allow using duplicate (non-unique) UID |
| -p, --password PASSWORD | use encrypted password for the new password |
| -s, --shell SHELL | new login shell for the user account |
| -u, --uid UID | new UID for the user account |
| -U, --unlock | unlock the user account |
| -Z, --selinux-user | new SELinux user mapping for the user account |
Userdel
Usage: userdel [options] LOGIN
Options:
| -f, --force | force removal of files, even if not owned by user |
| -h, --help | display this help message and exit |
| -r, --remove | remove home directory and mail spool |
groupadd
Usage: groupadd [options] GROUP
Options:
| -f, --force | force exit with success status if the specified group already exists |
| -g, --gid GID | use GID for the new group |
| -h, --help | display this help message and exit |
| -K, --key KEY=VALUE | overrides /etc/login.defs defaults |
| -o, --non-unique | allow create group with duplicate (non-unique) GID |
| -p, --password PASSWORD | use encrypted password for the new group |
| -r, --system | create a system account |
groupmod
Usage: groupmod [options] GROUP
Options:
| -g, --gid GID | force use new GID by GROUP |
| -h, --help | display this help message and exit |
| -n, --new-name NEW_GROUP | force use NEW_GROUP name by GROUP |
| -o, --non-unique | allow using duplicate (non-unique) GID by GROUP |
| -p, --password PASSWORD | use encrypted password for the new password |
groupdel
Usage: groupdel group
Resources: techotopia.com
alternative link download