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/24 19:55] – [TO ADD] rpjday | rh124_account_management [2026/10/29 16:47] (current) – [/etc/skel] rpjday | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| * nsswitch.conf | * nsswitch.conf | ||
| * how to lock a user account (passwd -l, usermod -L) | * how to lock a user account (passwd -l, usermod -L) | ||
| + | * newgrp, sg | ||
| + | |||
| + | ===== Links ===== | ||
| + | |||
| + | * [[https:// | ||
| ===== Typical tasks related to accounts ===== | ===== Typical tasks related to accounts ===== | ||
| Line 13: | Line 18: | ||
| * grant selected users root privilege to perform administrative duties | * grant selected users root privilege to perform administrative duties | ||
| * troubleshoot user accounts | * troubleshoot user accounts | ||
| + | * disable/ | ||
| * keep user accounts consistent across multiple systems (user equivalence) | * keep user accounts consistent across multiple systems (user equivalence) | ||
| Line 97: | Line 103: | ||
| * '' | * '' | ||
| * '' | * '' | ||
| - | * '' | + | * '' |
| ===== Everything related to user0 account ===== | ===== Everything related to user0 account ===== | ||
| Line 106: | Line 112: | ||
| < | < | ||
| - | $ ls -l /home | + | $ ls -l ~user0 (tilde) |
| - | $ ls -l /home/user0 | + | |
| </ | </ | ||
| Line 247: | Line 252: | ||
| -rw-r--r--. 1 root root 522 Oct 28 2024 .bashrc | -rw-r--r--. 1 root root 522 Oct 28 2024 .bashrc | ||
| </ | </ | ||
| - | |||
| - | **EXERCISE**: | ||
| ===== Account management ===== | ===== Account management ===== | ||
| Line 257: | Line 260: | ||
| < | < | ||
| - | $ sudo useradd | + | $ sudo useradd -G wheel user0 |
| - | $ passwd | + | $ passwd |
| </ | </ | ||
| Line 429: | Line 432: | ||
| -s, --stdin | -s, --stdin | ||
| </ | </ | ||
| + | |||
| + | That is, set someone' | ||
| < | < | ||
| - | $ echo "password" | passwd --stdin user0 | + | $ echo "plaintext_password" | passwd --stdin user0 |
| </ | </ | ||
| Line 568: | Line 573: | ||
| < | < | ||
| - | $ usermod -aG wheel user1 | + | $ usermod -aG wheel user0 |
| </ | </ | ||
| Line 650: | Line 655: | ||
| </ | </ | ||
| - | ==== newusers ==== | ||
| - | Update and create new users in batch. | ||
| - | |||
| - | < | ||
| - | $ newusers --help | ||
| - | Usage: newusers [options] | ||
| - | |||
| - | Options: | ||
| - | -b, --badname | ||
| - | -h, --help | ||
| - | -r, --system | ||
| - | -R, --root CHROOT_DIR | ||
| - | $ | ||
| - | </ | ||
| ===== Sample tasks ===== | ===== Sample tasks ===== | ||
| Line 675: | Line 666: | ||
| $ sudo useradd -u 3400 alex | $ sudo useradd -u 3400 alex | ||
| $ sudo passwd alex | $ sudo passwd alex | ||
| + | New password: ... | ||
| </ | </ | ||