Differences
This shows you the differences between two versions of the page.
linux_wiki:create_delete_and_modify_local_user_accounts [2016/03/05 16:28] billdozor |
linux_wiki:create_delete_and_modify_local_user_accounts [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Create Delete And Modify Local User Accounts ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Expect to create some local user accounts and add them to groups on the exam. | ||
- | |||
- | ---- | ||
- | |||
- | ===== User IDs and Files ===== | ||
- | |||
- | User IDs | ||
- | * 0 = root | ||
- | * 1-200 = Red Hat assigned system users | ||
- | * 201-999 = Other system users | ||
- | * 1000+ = Regular users | ||
- | |||
- | User files | ||
- | * /etc/passwd - user account details | ||
- | * /etc/shadow - user account' | ||
- | |||
- | Useradd default settings: | ||
- | * / | ||
- | |||
- | Login default settings | ||
- | * / | ||
- | |||
- | ---- | ||
- | |||
- | ===== Adding Users ===== | ||
- | |||
- | Add user with default settings | ||
- | <code bash> | ||
- | useradd rjones | ||
- | </ | ||
- | * Users belong to 1 primary group. | ||
- | * Users may belong to many other supplementary groups. | ||
- | |||
- | \\ | ||
- | Adding a user with a specific UID | ||
- | <code bash> | ||
- | useradd -u 5000 rjones | ||
- | </ | ||
- | * Creates a user " | ||
- | |||
- | ---- | ||
- | |||
- | ===== Modifying Users ===== | ||
- | |||
- | User comment, usually for a full name (also known as the GECOS field) | ||
- | <code bash> | ||
- | usermod -c " | ||
- | </ | ||
- | |||
- | \\ | ||
- | Lock user account (user cannot login) | ||
- | <code bash> | ||
- | usermod -L rjones | ||
- | </ | ||
- | * Note: This only locks the password from being used. It will not stop passwordless authentication such as public/ | ||
- | * Use " | ||
- | |||
- | \\ | ||
- | Unlock user account | ||
- | <code bash> | ||
- | usermod -U rjones | ||
- | </ | ||
- | |||
- | \\ | ||
- | Stop user from logging into a shell | ||
- | <code bash> | ||
- | usermod -s / | ||
- | </ | ||
- | |||
- | \\ | ||
- | Delete user account | ||
- | <code bash> | ||
- | userdel rjones | ||
- | </ | ||
- | * user cannot be logged in | ||
- | * -r => remove user's home directory and all files in it | ||
- | |||
- | ---- | ||