Podcast
Questions and Answers
What command is used to switch to another user account in a Linux system while obtaining their environment settings?
What command is used to switch to another user account in a Linux system while obtaining their environment settings?
- sudo -u username
- su - username (correct)
- login username
- su username
What is a key risk associated with using the root account directly?
What is a key risk associated with using the root account directly?
- User might forget their password
- Accidental execution of non-administrative tasks as root (correct)
- Background processes may fail
- Only certain commands can be executed
What information does the 'who' command provide about users?
What information does the 'who' command provide about users?
- Shows usernames along with their login times and locations (correct)
- Lists the primary group for all users logged in
- Displays only the usernames and passwords of currently logged-in users
- Provides details on user permissions and roles
What is the main purpose of creating groups in a system?
What is the main purpose of creating groups in a system?
What is a consequence of creating GIDs under 1000?
What is a consequence of creating GIDs under 1000?
Which command shows both local and network-based groups?
Which command shows both local and network-based groups?
What does the command 'grep root /etc/group' accomplish?
What does the command 'grep root /etc/group' accomplish?
Flashcards
User accounts on Linux
User accounts on Linux
User accounts control access to files and directories on a Linux system, assigning permissions based on user and group.
Administrative accounts (root)
Administrative accounts (root)
Root accounts hold supreme privileges on Linux systems, but using root directly carries significant risks.
su
command
su
command
su
command allows switching to another user's account and running a shell as that user .
sudo
command
sudo
command
Signup and view all the flashcards
/etc/passwd file
/etc/passwd file
Signup and view all the flashcards
System Accounts
System Accounts
Signup and view all the flashcards
What does /etc/passwd
store?
What does /etc/passwd
store?
Signup and view all the flashcards
What's the purpose of the *
(asterisk) in the Password
field of system accounts?
What's the purpose of the *
(asterisk) in the Password
field of system accounts?
Signup and view all the flashcards
What's the role of /etc/group
?
What's the role of /etc/group
?
Signup and view all the flashcards
What does the id
command do?
What does the id
command do?
Signup and view all the flashcards
Where is user account info stored?
Where is user account info stored?
Signup and view all the flashcards
What's a User Private Group (UPG)?
What's a User Private Group (UPG)?
Signup and view all the flashcards
Why use commands to create users?
Why use commands to create users?
Signup and view all the flashcards
What are groups used for?
What are groups used for?
Signup and view all the flashcards
How to create a group?
How to create a group?
Signup and view all the flashcards
What's the grep
command used for?
What's the grep
command used for?
Signup and view all the flashcards
What does the getent
command do?
What does the getent
command do?
Signup and view all the flashcards
What's important to consider when choosing a GID?
What's important to consider when choosing a GID?
Signup and view all the flashcards
How to check for existing groups?
How to check for existing groups?
Signup and view all the flashcards
Why plan group usage?
Why plan group usage?
Signup and view all the flashcards
Study Notes
Module 15: System and User Security
- Exam Objective 5.1 covers basic security and identifying user types on a Linux system.
- The objective focuses on various user types within a Linux environment.
Identifying User Accounts
- User accounts are designed to secure a Linux operating system.
- Accounts control file and directory access rights based on file permissions.
Users and Permissions
- User accounts belong to groups.
- This module covers commands to view user and group details and navigate between them.
Administrative Accounts
- Some commands require administrative or root privileges.
- Using the root account carries risks, so
sudo
orsu
are recommended for executing commands as root. - Risks of logging in as root:
- All processes run with root privileges.
- Easier to accidentally run non-admin tasks as root.
Switching Users
- The
su
command allows running a shell as a different user. - The
su
command with the[username]
parameter opens a new shell. - After pressing Enter, the correct password for the target user is needed.
Executing Privileged Commands
- The
sudo
command enables executing commands as another user. - It's useful for distributions where root login isn't permitted.
- Unlike
su
,sudo
prompts for your own password. This prevents a possible compromise of root privileges.
User Accounts
- The
/etc
directory contains files defining user and group accounts. - The
/etc/passwd
file provides user account information (name, password placeholder, UID, primary group ID, comment, home directory, shell). Fields are separated by colons.
Passwords
- The
/etc/shadow
file contains encrypted user passwords (access requires root privileges). - Fields in
/etc/shadow
include username, encrypted password, last password change, minimum/maximum password age, warning before password expiry, inactive period and password expiry time.
System Accounts
- Users typically log in using regular accounts (UID > 1000).
- The root account has UID 0 and special access.
- System accounts (UID 1-499) manage services on the system.
- System accounts in
/etc/passwd
and/etc/shadow
may have different fields (like home directory, shell, password).
Group Accounts
- Users can belong to one or more groups.
- The
/etc/passwd
file specifies the primary group membership. - The
/etc/group
file defines additional or secondary group memberships. - Group information includes the group name, password holder(an 'x' indicates no password), group ID, and list of members in the group file.
Viewing User Accounts
- The
id
command displays user and group information (UID, username, primary group, and details of other groups).
Viewing Current Users
-
The
who
command lists currently logged-in users, their terminal, and login times. -
The
w
command provides a more detailed view of logged-in users, including system status like user activity and load average.
Viewing Login History
- The
last
command displays login history, including previous and current login sessions. It gathers information from the/var/log/wtmp
file.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.