Podcast
Questions and Answers
What is the default group ownership of a file created by a user?
What is the default group ownership of a file created by a user?
The userdel command is used to add a user to a group.
The userdel command is used to add a user to a group.
False
What command is used to create a new user?
What command is used to create a new user?
useradd
The file ________ contains all user details as a list.
The file ________ contains all user details as a list.
Signup and view all the answers
What flag is used with the usermod command to add a user to a group?
What flag is used with the usermod command to add a user to a group?
Signup and view all the answers
The groupdel command is used to add a group.
The groupdel command is used to add a group.
Signup and view all the answers
Match the following commands with their functions:
Match the following commands with their functions:
Signup and view all the answers
What command is used to change the group ownership of a file or directory?
What command is used to change the group ownership of a file or directory?
Signup and view all the answers
What does the permission 'rw-' indicate?
What does the permission 'rw-' indicate?
Signup and view all the answers
The 'chown' command is used to change the permissions of a file.
The 'chown' command is used to change the permissions of a file.
Signup and view all the answers
What is the command used to change the permissions of a file?
What is the command used to change the permissions of a file?
Signup and view all the answers
Each file has a primary user that owns it and a ______________ assigned to it.
Each file has a primary user that owns it and a ______________ assigned to it.
Signup and view all the answers
What is the effect of setting the permissions to 700?
What is the effect of setting the permissions to 700?
Signup and view all the answers
Match the following commands with their functions:
Match the following commands with their functions:
Signup and view all the answers
The root user has limited privileges in Linux.
The root user has limited privileges in Linux.
Signup and view all the answers
What is the purpose of groups in Linux?
What is the purpose of groups in Linux?
Signup and view all the answers
What is the purpose of user and group management in Linux?
What is the purpose of user and group management in Linux?
Signup and view all the answers
The /etc/gshadow file contains all user accounts details as a list.
The /etc/gshadow file contains all user accounts details as a list.
Signup and view all the answers
What is the purpose of the 'chage' command in Linux?
What is the purpose of the 'chage' command in Linux?
Signup and view all the answers
The password inactive date is the deadline for using an expired password, after the deadline the user account will be ______________________ if the expired password is not changed.
The password inactive date is the deadline for using an expired password, after the deadline the user account will be ______________________ if the expired password is not changed.
Signup and view all the answers
What is the purpose of file system permissions in Unix?
What is the purpose of file system permissions in Unix?
Signup and view all the answers
The numerical value 777 for a directory grants only the owner full permissions.
The numerical value 777 for a directory grants only the owner full permissions.
Signup and view all the answers
What is the purpose of password expiration date?
What is the purpose of password expiration date?
Signup and view all the answers
Match the following password aging policy settings with their descriptions:
Match the following password aging policy settings with their descriptions:
Signup and view all the answers
What is the meaning of the numerical value 755 for file permissions?
What is the meaning of the numerical value 755 for file permissions?
Signup and view all the answers
A file with permissions $ ls -l –rwxrw- - - -. indicates that the file owner has permissions to ______________ the file.
A file with permissions $ ls -l –rwxrw- - - -. indicates that the file owner has permissions to ______________ the file.
Signup and view all the answers
The /etc/login.defs file is used to manage user accounts in Linux.
The /etc/login.defs file is used to manage user accounts in Linux.
Signup and view all the answers
What is the permission level of 0 in numerical value?
What is the permission level of 0 in numerical value?
Signup and view all the answers
What is the purpose of sending a warning message to users to change the password?
What is the purpose of sending a warning message to users to change the password?
Signup and view all the answers
The permission level of 7 in numerical value means read and write permissions only.
The permission level of 7 in numerical value means read and write permissions only.
Signup and view all the answers
Match the following numerical values with their corresponding permission levels:
Match the following numerical values with their corresponding permission levels:
Signup and view all the answers
Study Notes
File/Folder Permissions and Ownership
- File system permissions control the ability of user and group accounts to read, modify, and execute the contents of files and to enter directories.
- Three types of access (permissions): read (r), write (w), execute (x).
- Each file belongs to a specific user and group (ownership).
- Access to files is controlled by user (u), group (g), and other/everyone (o) permission bits, usually set using a numerical value.
Access Levels and Permissions
- Different access levels depending on numerical values:
- 0 (---) – no access to the file whatsoever
- 1 (--x) – execute permissions only
- 2 (-w-) – write permissions only
- 3 (-wx) – write and execute permissions
- 4 (r--) – read permissions only
- 5 (r-x) – read and execute permissions
- 6 (rw-) – read and write permissions
- 7 (rwx) – read, write, and execute permissions (full permissions)
Directory Permissions
- Base permission for a directory is 777 (drwxrwxrwx), which grants everyone the permissions to read, write, and execute.
- Example of 644 permissions:
- Owner/User: Read and Write
- Group: Read only
- Other/Everyone: Read only
Setting Permissions and Ownership
- To set permissions, use the
chmod
command followed by the permission value and the file name. - Example:
chmod 755 file_name
sets the permissions to 755 for the filefile_name
. - To recursively change permissions, use the
-R
flag:chmod -R 755
. - To change ownership, use the
chown
command followed by the user and group names, and the file name. - Example:
chown user:siteground file_name
sets the owner touser
and the group tositeground
.
Understanding Users and Groups
- In Linux, a user is an individual who interacts with the system, with a unique username and user ID (UID).
- User accounts are used to log in, run processes, and access files and directories.
- Groups are collections of users, used to simplify access control and permissions management.
- A group has a unique group ID (GID).
User Management
- Creating users: use the
useradd
command followed by the username. - Example:
sudo useradd viswa
creates a new user namedviswa
. - Setting user password: use the
passwd
command followed by the password. - Modifying user attributes: use the
usermod
command. - Deleting users: use the
userdel
command with the-r
flag to remove the user and their home directory.
Group Management
- Creating groups: use the
groupadd
command followed by the group name. - Example:
sudo groupadd mygroup
creates a new group namedmygroup
. - Adding users to groups: use the
usermod
command with the-aG
flag. - Example:
sudo usermod -aG mygroup username
adds the user to themygroup
group. - Changing group ownership of files: use the
chown
command with the group name. - Deleting groups: use the
groupdel
command followed by the group name.
Group Database Files
-
/etc/group
contains all group details as a list. -
/etc/gshadow
contains all group members details as a list.
Password Aging Policy
- To ensure system and network security, various security mechanisms are used, including user password expiration.
- The
chage
command and/etc/login.defs
file are used to manage password policies. - Password aging policy settings include:
- The last password change date
- The password expiration date
- The password inactive date
- The account expiration date
- The minimum number of days between password changes
- The maximum number of days between password changes
- The number of days of warning before the password expires
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn about Unix file system permissions and how they control access to files and directories. Understand read, write, and execute permissions, as well as file ownership.