RHCSA Ch6 Flashcards

1
Q

change owner of a file

A

chown user1 file.txt

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

change group owner of a file

A

chown :accounting file.txt

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

Change user and group owners

A

chown user1:accounting file.txt

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

what are the values of rwx

A
r = 4
w = 2
x = 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

give user rwx, group rx, and other no permission - numeric and symbolic

A

chmod 750 file.txt

chmod u=rwx,g=rx,o= file.txt

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

giver user rwx using symbolic permissions

A

chmod u+rwx file.txt

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

take away execute from all users

A

chmod ugo-x file.txt
chmod a-x file.txt
a=all

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

explain umask

A

umask
default is 0022
default perms for directories are 777. Subtract 022 from 777 = 755 (rwx,rx,rx)
default perms for files is 666. Subtract 022 from 666 = 644 (rw,r,r)

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

changed umask

A

umask 0002 = only good for current session
To make persistent, edit ~/.bashrc and type umask 0002
To change system wide, edit /etc/profile.d/umask.sh
- if [ “$UID” -ge 1000 ] ;then
umask 0002
fi
^ for any user with an ID of 1000 or greater, their umask will be 0002

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

set the SUID bit on a file

A

sudo chmod 4755 /usr/bin/su

sudo chmod u+s /usr/bin/su

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

set the SGID bit to a file

A

chmod 2755 /usr/bin/screen
chmod g+s /usr/bin/screen
any file created in screen directory, will be own by that group

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

search for SUID and SGID set

A

SUID
find / -perm -4000
SGID
find / -perm -2000

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

What is the sticky bit

A

Makes sure that other users cannot move or delete a file in a directory with the sticky bit set

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

how do you set the sticky bit

A

chmod 1777 stickydirectory

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

list acl of a file

A

getfacl file.txt

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

create a ACL for a user on a file

A

setfacl -m user:: file.txt
setfacl -m user:bob:rwx /home/file.txt
setfacl -m u:bob:rwx /home/file.txt
-m = modify

17
Q

create ACL for a group on a file

A

setfacl -m group:accounting:rx file.txt

setfacl -m g:accounting:rx file.txt

18
Q

set ACL for a user and group in one command

A

setfacl -m u:bob:rwx,g:accounting:rx file.txt

19
Q

create ACL for directory

A

setfacl -R -m user:bob:rwx /home/bob

-R = for files that currently exist in the directory

20
Q

set default acl on directory

A

sudo setfacl -d -m user:bob:rwx dir1

ensures that new files will grant bob rwx

21
Q

What are the three different options to delete and ACL

A
  • x Remove specific acl
  • k Remove all default acl
  • b remove all acl