Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| rh124_account_management [2026/10/19 19:12] – [userdel] rpjday | rh124_account_management [2026/10/19 20:02] (current) – [Changing someone's password] rpjday | ||
|---|---|---|---|
| Line 144: | Line 144: | ||
| uid=1000(rpjday) gid=1000(rpjday) groups=1000(rpjday), | uid=1000(rpjday) gid=1000(rpjday) groups=1000(rpjday), | ||
| </ | </ | ||
| + | |||
| + | You do not need an entry in ''/ | ||
| ==== cat /etc/shadow (secure) ==== | ==== cat /etc/shadow (secure) ==== | ||
| Line 165: | Line 167: | ||
| ===== Account management ===== | ===== Account management ===== | ||
| - | ==== Creating a new account ==== | + | ==== How class accounts are created |
| - | + | ||
| - | === How class accounts are created === | + | |
| For each account: | For each account: | ||
| Line 176: | Line 176: | ||
| </ | </ | ||
| - | === useradd === | + | ==== useradd |
| The output from '' | The output from '' | ||
| Line 228: | Line 228: | ||
| </ | </ | ||
| - | === usermod === | + | ==== usermod |
| < | < | ||
| Line 269: | Line 269: | ||
| </ | </ | ||
| - | === userdel === | + | ==== userdel |
| < | < | ||
| Line 284: | Line 284: | ||
| -P, --prefix PREFIX_DIR | -P, --prefix PREFIX_DIR | ||
| -Z, --selinux-user | -Z, --selinux-user | ||
| + | </ | ||
| + | |||
| + | ==== Changing someone' | ||
| + | |||
| + | < | ||
| + | $ passwd user0 | ||
| + | </ | ||
| + | |||
| + | Note '' | ||
| + | |||
| + | < | ||
| + | $ passwd --help | ||
| + | Usage: passwd [options] [LOGIN] | ||
| + | |||
| + | Options: | ||
| + | -a, --all | ||
| + | -d, --delete | ||
| + | -e, --expire | ||
| + | -h, --help | ||
| + | -k, --keep-tokens | ||
| + | -i, --inactive INACTIVE | ||
| + | to INACTIVE | ||
| + | -l, --lock | ||
| + | -n, --mindays MIN_DAYS | ||
| + | change to MIN_DAYS | ||
| + | -q, --quiet | ||
| + | -r, --repository REPOSITORY | ||
| + | -R, --root CHROOT_DIR | ||
| + | -P, --prefix PREFIX_DIR | ||
| + | -S, --status | ||
| + | -u, --unlock | ||
| + | -w, --warndays WARN_DAYS | ||
| + | -x, --maxdays MAX_DAYS | ||
| + | change to MAX_DAYS | ||
| + | -s, --stdin | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | $ echo " | ||
| </ | </ | ||
| Line 349: | Line 388: | ||
| $ man 1 chsh | $ man 1 chsh | ||
| $ man 1 chfn | $ man 1 chfn | ||
| - | </ | ||
| - | |||
| - | ===== Managing user accounts ===== | ||
| - | |||
| - | ==== passwd ==== | ||
| - | |||
| - | < | ||
| - | $ passwd user0 | ||
| - | </ | ||
| - | |||
| - | ==== usermod ==== | ||
| - | |||
| - | < | ||
| - | $ usermod --help | ||
| - | Usage: usermod [options] LOGIN | ||
| - | |||
| - | Options: | ||
| - | -a, --append | ||
| - | mentioned by the -G option without removing | ||
| - | the user from other groups | ||
| - | -b, --badname | ||
| - | -c, --comment COMMENT | ||
| - | -d, --home HOME_DIR | ||
| - | -e, --expiredate EXPIRE_DATE | ||
| - | -f, --inactive INACTIVE | ||
| - | to INACTIVE | ||
| - | -g, --gid GROUP force use GROUP as new primary group | ||
| - | -G, --groups GROUPS | ||
| - | -h, --help | ||
| - | -l, --login NEW_LOGIN | ||
| - | -L, --lock | ||
| - | -m, --move-home | ||
| - | new location (use only with -d) | ||
| - | -o, --non-unique | ||
| - | -p, --password PASSWORD | ||
| - | -P, --prefix PREFIX_DIR | ||
| - | -r, --remove | ||
| - | mentioned by the -G option without removing | ||
| - | the user from other groups | ||
| - | -R, --root CHROOT_DIR | ||
| - | -s, --shell SHELL new login shell for the user account | ||
| - | -u, --uid UID new UID for the user account | ||
| - | -U, --unlock | ||
| - | -v, --add-subuids FIRST-LAST | ||
| - | -V, --del-subuids FIRST-LAST | ||
| - | -w, --add-subgids FIRST-LAST | ||
| - | -W, --del-subgids FIRST-LAST | ||
| - | -Z, --selinux-user SEUSER | ||
| - | --selinux-range SERANGE | ||
| - | |||
| </ | </ | ||
| Line 473: | Line 462: | ||
| To give someone superuser access, add them to the '' | To give someone superuser access, add them to the '' | ||
| - | ===== Deleting groups and users ===== | + | |
| ==== Deleting groups ==== | ==== Deleting groups ==== | ||
| Line 488: | Line 477: | ||
| </ | </ | ||
| - | ==== Deleting users ==== | + | ==== groupmems |
| < | < | ||
| - | $ userdel | + | $ groupmems |
| - | Usage: | + | Usage: |
| Options: | Options: | ||
| - | -f, --force force some actions that would fail otherwise | + | -g, --group groupname |
| - | e.g. removal | + | |
| - | | + | |
| - | -h, --help | + | |
| - | -r, --remove | + | |
| -R, --root CHROOT_DIR | -R, --root CHROOT_DIR | ||
| - | | + | |
| - | -Z, --selinux-user | + | Actions: |
| + | | ||
| + | -d, --delete username | ||
| + | -h, --help | ||
| + | -p, --purge | ||
| + | -l, --list | ||
| </ | </ | ||
| + | |||
| + | ===== Giving someone superuser access ===== | ||
| + | |||
| + | First, add them to the '' | ||
| + | |||
| + | < | ||
| + | $ usermod -aG wheel user1 | ||
| + | </ | ||
| + | |||
| + | In addition, add this line to either ''/ | ||
| + | |||
| + | < | ||
| + | user1 ALL=(ALL) NOPASSWD: ALL | ||
| + | </ | ||
| + | |||
| + | |||