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
How do you add a user to a new group?
usermod G [list all groups separated by commas including old and new groups.]
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?
gpasswd
How do you modify a group’s settings without using commands?
Modify the /etc/group file or
/etc/gshadow file
How do you delete groups?
groupdel [groupname]
don’t forget to find and delete orphan files.
What is syslogd and how is it configured?
It is the system log daemon and is configured through the /etc/syslog.conf file
How do you manually create log entries?
logger with it’s options
Often used in scripts to log details of what the script does
How do you alter log rotation?
edit /etc/logrotate.conf
refers to /etc/logrote.d