RHCSA Ch7 Flashcards

1
Q

see the current mode of SELinux

A

sestatus
and
getenforce

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

change SELinux mode

A

setenforce permissive (temporary and only last for that sessions)

edit /etc/selinux/config
change the SELINUX line to whatever mode necessary

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

get security context for user

A

id -Z

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

see security context for all processes

A

ps -eZ

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

get security context for files

A

ls -lZ

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

change security type of a file

A

chcon -t etc_t file.txt

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

change the security type of a file to what the system thinks it should be

A

restorecon file.txt

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

reset all security contexts

A

make a file call /.autorelabel

then reboot

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

make security context persisent even after relablel

A

sudo semanage fcontext -a -t etc_t /home/user1/file.txt

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

list SELinux booleans

A

getsebool -a
sestatus -b
sudo semanage boolean -l = gives a brief description

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

change a security boolean

A

sudo setsebool mozilla_plugin_use_gps on = not persistant

sudo setsebool -P mozilla_plugin_use_gps = persistant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
options to keep security contexts 
cp
mv
tar
rsync
A

cp -a
mv
tar –selinux
rsync -a X

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

Interact with farewalld

A

firewall-cmd

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

firewall timeout

A

sudo firewall-cmd –timeout=60

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

Make a permenant firewall rule

A

sudo firewall-cmd –permanent

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

allow http traffic in

A

sudo firewall-cmd –permanent –add-service=http

sudo firewall-cmd –reload

17
Q

remove the http rule

A

sudo firewall-cmd –permanent –remove-service=http

sudo firewall-cmd –reload

18
Q

add and remove port firewall rule

A

sudo firewall-cmd –permanent –add-port=443/tcp

sudo firewall-cmd –reload

19
Q

list firewall rules

A

sudo firewall-cmd –get-services