GX5 Security and File Permissions Flashcards
5.1: Basic Security and Identifying User Types
What is the difference between root and standard users?
Root user: The superuser with full control over the system.
Standard user: Has limited privileges and cannot perform administrative tasks without elevated permissions.
5.1: Basic Security and Identifying User Types
What are system users?
System users are accounts created for system processes and services, often with restricted access.
5.1: Basic Security and Identifying User Types
What do the /etc/passwd, /etc/shadow, and /etc/group files store?
/etc/passwd: Stores user account information.
/etc/shadow: Stores encrypted passwords.
/etc/group: Stores group information.
5.1: Basic Security and Identifying User Types
How do you display user information such as user ID, group ID, and groups?
Use the id command. Example: id username
5.1: Basic Security and Identifying User Types
What commands can you use to check who is logged in and what they are doing?
who: Shows who is logged in.
w: Shows who is logged in and their activity.
last: Displays a list of recent logins.
5.1: Basic Security and Identifying User Types
What is the purpose of sudo and su?
sudo: Allows a permitted user to execute commands as the root user.
su: Switches to the root user or another user, requiring the root password.
5.2: Creating Users and Groups
How do you add a new user to the system?
Use the useradd command. Example: useradd username
5.2: Creating Users and Groups
How do you add a new group?
Use the groupadd command. Example: groupadd groupname
5.2: Creating Users and Groups
What is the /etc/skel/ directory used for?
It contains default configuration files for new users.
5.2: Creating Users and Groups
How do you set or change a user’s password?
Use the passwd command. Example: passwd username
5.3: Managing File Permissions and Ownership
What is the purpose of ls -l?
It lists files and directories with detailed information, including permissions, ownership, and file size.
5.3: Managing File Permissions and Ownership
What is the purpose of ls -a?
It lists all files, including hidden files (those starting with a dot).
5.3: Managing File Permissions and Ownership
What are the three types of file permissions?
Read (r): Allows viewing the contents of a file.
Write (w): Allows modifying the file.
Execute (x): Allows running the file as a program.
5.3: Managing File Permissions and Ownership
What does the command chmod do?
chmod changes the permissions of a file or directory. Example: chmod 755 file.txt
5.3: Managing File Permissions and Ownership
What does the command chown do?
chown changes the ownership of a file or directory. Example: chown user:group file.txt
5.3: Managing File Permissions and Ownership
How are file permissions represented in ls -l?
Permissions are displayed as a 10-character string, e.g., -rwxr-xr–. The first character indicates the file type, and the next 9 characters represent read, write, and execute permissions for the user, group, and others.
5.4: Special Directories and Files
What is the difference between /tmp/ and /var/tmp/?
/tmp/: Temporary files that may be deleted after a reboot.
/var/tmp/: Temporary files that persist across reboots.
5.4: Special Directories and Files
What is the Sticky Bit?
A permission that ensures only the file owner, root, or the user who created a file can delete or modify it in a shared directory (e.g., /tmp).
5.4: Special Directories and Files
How do you list directories without showing their contents?
Use ls -d. Example: ls -d /home/*
5.4: Special Directories and Files
How do you create a symbolic link (symlink) in Linux?
Use the ln -s command. Example: ln -s /path/to/original /path/to/link