Podcast
Questions and Answers
Which permission group applies only to the owner of a file or directory?
Which permission group applies only to the owner of a file or directory?
- Owner (correct)
- Group
- Read
- All Users
What permission type allows a user to modify a file or directory?
What permission type allows a user to modify a file or directory?
- id
- Read
- Write (correct)
- Execute
Which command allows you to change a file's group ownership?
Which command allows you to change a file's group ownership?
- chgrp (correct)
- chown
- su
- chmod
What does the 'id' command display?
What does the 'id' command display?
Which file type refers to a device handling data in blocks, like a hard-drive?
Which file type refers to a device handling data in blocks, like a hard-drive?
What does the 'umask' command set?
What does the 'umask' command set?
What is the binary equivalent of the file mode 'rw- rw- r--'?
What is the binary equivalent of the file mode 'rw- rw- r--'?
When using the 'chown' command with the argument 'nika:users', what ownership changes occur?
When using the 'chown' command with the argument 'nika:users', what ownership changes occur?
Which command is used to change the group ownership of a file in Linux?
Which command is used to change the group ownership of a file in Linux?
In octal notation, what is the permission mode for a file with 'rw- r-- r--' permissions?
In octal notation, what is the permission mode for a file with 'rw- r-- r--' permissions?
Which permission type allows a user to read and execute a file but not modify it?
Which permission type allows a user to read and execute a file but not modify it?
What is the binary equivalent of the file mode 'rw- r-- r--'?
What is the binary equivalent of the file mode 'rw- r-- r--'?
Which file type handles data in blocks, like a hard drive?
Which file type handles data in blocks, like a hard drive?
What does the 'su' command allow you to do in Linux?
What does the 'su' command allow you to do in Linux?
What does the 'passwd' command enable users to change in Linux?
What does the 'passwd' command enable users to change in Linux?
What is the binary equivalent of the file mode '*Property of STI: rw- rw- rw-'?
What is the binary equivalent of the file mode '*Property of STI: rw- rw- rw-'?
Flashcards are hidden until you start studying
Study Notes
umask Command
- The
umask
command sets default permissions for newly created files and directories. - A common binary umask is
0002
, which results in file permissions ofrw-rw-r--
.
Permissions and Modes
- Original file modes can be expressed in octal notation:
777
: Full permissions for everyone (not recommended).755
: Owner can read, write, execute; others can read and execute.700
: Owner has all permissions; others have none (private use).666
: All users can read/write.644
: Owner can read/write; others can only read.600
: Owner can read/write; others have no permissions.
chown Command
- The
chown
command changes file ownership. - Sample usage:
nika
: Changes ownership to user "nika".nika:users
: Changes ownership to user “nika” and group “users”.:admins
: Changes group ownership to “admins”.
File Permission Values
- Octal to binary notations:
0
-000
(no permissions)1
-001
(execute)2
-010
(write)3
-011
(write + execute)4
-100
(read)5
-101
(read + execute)6
-110
(read + write)7
-111
(read + write + execute)
Directory Permission Values
- Directory permissions are critical for managing access:
777
: Full permissions (not recommended).755
: Owner has full access; others can list.700
: Directory is private to the owner.
Symbolic Notation for Permissions
- Represents permissions using combinations of symbols:
u
: User (owner)g
: Group ownero
: Othersa
: All (user, group, others)
- Symbolic commands examples:
u+x
: Grants execute permission to the owner.u-x
: Revokes execute permission from the owner.go=rw
: Sets group and others to read/write permissions, removes execute.u+x, go=rx
: Grants execute to owner; group and others get read/execute permissions.
Overall Best Practices
- Avoid using
777
permissions to maintain security. - Use
umask
carefully to default to safer permissions. - Regularly review file and directory permissions to ensure they meet security needs.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.