CH 5: SELinux Flashcards

1
Q

find SELinux status?

A

getenforce

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

set SELinux to Permissive/Enforcing

A

setenforce 0 (for permissive), setenforce 1 (for enforcing)

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

set SELinux to disabled

A

edit /etc/selinux/config file SELINUX=disabled

reboot to take affect

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

how to set the SELinux context for a file

A

semanage fcontext

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

change the context of /virtual

A

chcon -t httpd_sys_content_t /virtual

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

restore the original context of a file or directory such as /virtual

A

restorecon -v /virtual

the -v means show changes, you can add -v -v -v for additional info

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

most common regular expression used by semanage fcontext

A

(/.*)?

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