Chapter 7 Flashcards
How does Linux represent users and groups internally?
With numbers.
Where will you find the group file?
/etc/group
What file defines user accounts?
/etc/passwd
What do we call user numbers and group numbers, respectively?
UID User IDs and GID Group IDs.
What are the first 100 user and group ids and what are they for?
0-99, they are reserved for system use, things like accounts associated with utilities and functions
What is the root GID and UID>
0
What command adds users.
useradd (sometimes adduser)
How do you change user passwords?
passwd [username]
To change your own password omit the username.
Why use usermod?
It allows you to modify current accounts. It supports -m which moves files to the user’s new directory, also -l which changes the username if need be. Also -L and -U to lock and unlock a user’s password.
When you change a username, how do you help the user keep permissions?
chown -R sally /home/sally
This gives her permissions of all files in her home directory
Why use chage?
It allows you to modify accounts to expire if the password hasn’t been changed often enough or a specific time has expired.
Name a way to alter accounts without using commands.
Directly edit /etc/passwd (Where user info is stored) or
/etc/shadow (Where the shadow password is stored.
How should you remove users?
Change ownership or backup their files.
userdel -r [username]
-r removes their files
-f or –force forces deletion even if they are logged in.
How do you add a group?
groupadd
How do you hunt down stray user files after the user has been deleted?
Use find and their former user id.
How do you edit an existing groups settings?
groupmod