SELinux Konfiguration: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 61: | Zeile 61: | ||
<!-----> | <!-----> | ||
drwxr-xr-x. 3 root root unconfined_u:object_r:httpd_sys_content_t:s0 18 12. Jan 13:17 /web | drwxr-xr-x. 3 root root unconfined_u:object_r:httpd_sys_content_t:s0 18 12. Jan 13:17 /web | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Version vom 12. Januar 2023, 13:21 Uhr
Verlegen eines Netzwerkports
- SSH soll den Port 9922 statt 22 benutzen
- Standardmäßig werden Ports nach ihrem Programm benannt, also: programm_port_t
- Zur Überprüfung kann auch über semanage nachgeschaut werden
- semanage port -l | grep ssh
ssh_port_t tcp 22
- semanage port -a -p tcp 9922 -t ssh_port_t
Booleans
Booleans anzeigen
- getsebool -a
Regeln zu Booleans anzeigen
- sesearch -b boolean --allow
- sesearch -b boolean -T
Booleans an-/ausschalten
- setsebool boolean 1
- setsebool boolean 0
Dateityp ändern
Temporär
- chcon -t httpd_sys_content_t "/web(/.*)?"
- ls -dlZ /web
drwxr-xr-x. 3 root root unconfined_u:object_r:httpd_sys_content_t:s0 18 12. Jan 13:17 /web
- restorecon -R -v /web
Relabeled /web from unconfined_u:object_r:httpd_sys_content_t:s0 to unconfined_u:object_r:default_t:s0 Relabeled /web/html from unconfined_u:object_r:httpd_sys_content_t:s0 to unconfined_u:object_r:default_t:s0 Relabeled /web/html/test from unconfined_u:object_r:httpd_sys_content_t:s0 to unconfined_u:object_r:default_t:s0
Rebootfähig
- semanage fcontext -a -t httpd_sys_content_t “/web(/.*)?”
- restorecon -R /web
- ls -dlZ /web
drwxr-xr-x. 3 root root unconfined_u:object_r:httpd_sys_content_t:s0 18 12. Jan 13:17 /web