Permissions Flashcards

1
Q

How to view file/folder permissions?

A

We can use “ls -l” command to view permissions.

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

How to read the following permission: drwxr-xr-x 19 djpetro djpetro 4096 Mar 30 12:02 djpetro?

A

d(first letter)=directory.
rwx(beginning)= owner “djpetro” has read, write and execute permissions
r-x(in the middle)=group “djpetro” has read and execute permissions
r-x(at the end)= all others have read and execute permissions.
After that we see directory information (date created, etc..)

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

Can permissions be set with numbers?

A

Yes, they were set with numbers in the past

0 - none | 1 - execute | 2 - write | 4 - read

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

How do we modify the permission?

A

Using “chmod” command

e.g. chmod u=rwx,g+w,o=rx or chmod -R 755

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

Where do default permissions come form?

A

/etc/profile - for all users

~/.bashrc - for individual user

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

What is umask?

A

Umask is a bash built-in command that is used to set default permissions for users when creating new file/folders.
Permissions are set with numbers, umask has it’s own numbering system.
e.g. umask 022 - typcal default value

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

How do we change owner of the file/folder?

A

We can use “chown” command to change both owner and group.

e.g. chown sarah:sales

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

How do we change just the group of the file?

A

We can use “chown” or “chgrp” to change file group.

e.g. chgrp sales or chown :sales

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

What is FACL?

A

File System Access Control List is basically a list referenced by file/folders for extending permissions. We can use facl to permissions for more then on user/grou to a folder/file.
We manage list entries with setfacl /getfacl commands.
e.g. setfacl -m u:sarah:rwx

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

Are FACL’s available on all distros?

A

Mostly, but on some distros must be enabled with acl option in /etc/fstab
RedHat enables it by default

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

Are group FACL permissions handled the same way as user?

A

Similarly

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

Do FACL works on directories as well?

A

Yes, we can use inheritance as well

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

Are there any other advanced permissions besides FACL?

A

Sticky bit - protects files/folders from renaming or deletion
Files/folders with sticky bit can only be renamed/deleted by root user

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