SELinux Konfiguration: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 33: | Zeile 33: | ||
* setsebool ''boolean'' 1 | * setsebool ''boolean'' 1 | ||
* setsebool ''boolean'' 0 | * setsebool ''boolean'' 0 | ||
| + | |||
| + | <!-----> | ||
| + | <span id="dateityp-ändern"></span> | ||
| + | = Dateityp ändern = | ||
| + | |||
| + | <span id="temporär"></span> | ||
| + | == Temporär == | ||
| + | |||
| + | chcon -t ''httpd_sys_content_t'' “/web(/.*)?” + ls -dlZ /web | ||
| + | |||
| + | <!-----> | ||
| + | <span id="rebootfähig"></span> | ||
| + | == Rebootfähig == | ||
| + | |||
| + | * semanage fcontext -a -t httpd_sys_content_t “/web(/.*)?” | ||
| + | * restorecon -R -v /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 | ||
| + | * ls -lZ /web | ||
| + | |||
| + | <!-----> | ||
| + | drwxr-xr-x. 2 root root unconfined_u:object_r:httpd_sys_content_t:s0 18 12. Jan 13:19 html | ||
| + | * | ||
Version vom 12. Januar 2023, 13:17 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
Rebootfähig
- semanage fcontext -a -t httpd_sys_content_t “/web(/.*)?”
- restorecon -R -v /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
- ls -lZ /web
drwxr-xr-x. 2 root root unconfined_u:object_r:httpd_sys_content_t:s0 18 12. Jan 13:19 html