Lesson 3: Managing Permissions and Ownership Flashcards

1
Q

True of False ls -l will allow you to view permission set

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the following permission symbols d-r-w-x–

A

Directory-read-write-executable-none

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What common command do you use to modify per

qmission?

A

The change file mode command “chmod”

In symbolic mode, the syntax of the chmod command is:chmod {access context} {operators} {permission attributes} {file/directory names}

example: to add read and write permissions to my file for the owner and the group: chmod u+rw,g+rw myfile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the types of users and entities can you give permission to?

A

Owner (u): The owner of the file or directory, also simply referred to as the user

Group (g): The file or directory’s group and all users belonging to that group

Other (o): All other users (neither owner nor group member)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where does default permission come from?

A

The default permission come from the in /etc/profile for all users OR ~/.bashrc for one user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do we define who the owner or group is?

A

chown - which can be used to change owner
or chgrp - which can change group of a file

The syntax of the chown command: chown {user name}:{group name} {file ordirectory name} -> to change the owner to the specified user, as well as the specified group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you seize ownership of every directory and its sub directories?

A

chown -R [user] directory/*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is FACL?

A

File Access Control List

made up of ACE - Access Control Entries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you confirm if ACL is enable of a object?

A

getfacl {object_name} and see what returns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do give access to an object to another user without changing ownership?

A

You can use setfacl -m modify

the option -s allow you to set permission which may override what is already set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What limitations do we have with basic permissions?

A

Limitations only allow one user and one group. It is not very flexible and the users apply their primary group by default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can you overcome the limitations of basic permissions?

A

Be using ACLs/FACLs, which allows assigning permissions to more than one user/group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you assign group permission using FACL?

A

You use setfacl -m g::rwx

The syntax of the setfacl command is setfacl [-bR] [-mx {acl_spec}] {file/directory names}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you assign permission using FACL on a directory?

A

Directory permissions can be passed down to files through enable inheritance or use setfacl -m d:g::rwx

Note: The d: indicates it is a directory default and f: can be used to set a file default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What advanced permission prevent files from being deleted by anyone other then root or the file owner?

A

Sticky bit, files with the sticky bit can only be deleted/renamed by root or the file owner and allows for “Friendly” shared directories.

example: chmod o+t

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What command displays permission information?

A

ls -l

command gives you a long list of the files and directories in your currentworking directory.

17
Q

What two modes does chmod support?

A

symbolic mode and absolute mode

18
Q

What is chmod absolute mode?

A

Absolute mode, uses octal (base-8) numbers to specify permissions. Each permission (r/w/x) has an associated number.
4=Read, 2=Write and 1=Execute

the syntax of the chmod command is chmod {number} {file/directory name}

commonly assigned permissions in “Absolute Mode”

  • 755u= rwx , g=rx , o=rx
  • 700u= rwx , g= , o=
  • 644u= rw , g=r , o=r
  • 600u= rw , g= , o=
19
Q

How do you view permissions of a directory?

A

ls -ld {directory name}

20
Q

uHow do you change default permission ?

A

You can use the umask command to set the default permissions for a session, or the default permissions for each user in their .bashrc file.

21
Q

How do you change group ownership for a file or directory?

A

chgrp

The syntax of the chgrp command is chgrp {group name} {file/directory name}

22
Q

What is SUID?

A

SUID or setuid, is a special permissions that allows a user to have similar permissions as the owner of the file.

23
Q

What is SGID?

A

SGID, or setgid, is the special permission that allows a user to have similar permissions as the group owner of the file.

note: SGID can also be set on directories. Any subdirectories created in this directory will automatically inherit the SGID permission.

24
Q

How do you set the SUID and or SGID special permissions?

A

SUID and SGID are both set using the chmod command.

the syntax is as follows:

chmod u+s for setting SUID

chmod g+s for setting SGID

25
Q

How do you prevent a file or directory from being modified, even by the root user?

A

User the “ immutable flag “ attribute.

This is useful for files with a high degree of sensitivity and importance, and which are also not likely to change any time soon.

note: when viewing file attributes, the lowercase i character indicates that the immutable flag is set.

26
Q

What command list the attributes of a file or directory?

A

lsattr

The syntax of the lsattr command is lsattr [options] {file/directory names}

27
Q

What command changes the attributes of a file or directory?

A

chattr

The syntax of the chattr command is chattr [-R] [-v {version}] [+-{attributes}] {file/directory names}