Osiemnaste_21

 0    21 Datenblatt    michalesq
Drucken spielen überprüfen
 
Frage - Antworten -
list all available contexts existing in the system and files associated with them
Lernen beginnen
semanage fcontext -l
list all available contexts existing in the system and files associated with them optional, any subdirectory coming after / has the same contenx as parent directory in SELinux
Lernen beginnen
(/.*)?
restore context of the parent directory to the content
Lernen beginnen
restorecon index. html
which file has to exist to relabel files in the system
Lernen beginnen
/.autorelabel
How to apply context to the firectory?
Lernen beginnen
semanage fcontex -a -t <context_t> '<directory(/.*)?>'
restoring content recursively, verbosely
Lernen beginnen
restorecon -Rv /content
How to remove context?
Lernen beginnen
seamange fcontex -d "<directory(/.*)?>"
display boolean values
Lernen beginnen
getsebool -a / semanage boolean -t
enables homedirs in SELinux (not persistent)
Lernen beginnen
setsebool httpd_enable_homedirs on
enables homedirs in SELinux (persistent)
Lernen beginnen
setsebool -P httpd_enable_homedirs
How to install troubleshooter for selinux?
Lernen beginnen
yum install setroubleshoot-server
which file contains information about SELinux violations?
Lernen beginnen
/var/log/audit/audit.log
How to run troubleshooter?
Lernen beginnen
sealert -a /var/log/audit/audit. log
" Replaces one with unos in a case-insensitive manner, so it will print ""unos TWO"""
Lernen beginnen
echo ONE TWO | sed "s/one/unos/I"
A way to replace dos2unix:)
Lernen beginnen
sed 'G; G' file. txt
Delete all spaces in front of every line of file. txt
Lernen beginnen
sed 's/^[^t]*//' file. txt
Delete all spaces at the end of every line of file. txt
Lernen beginnen
sed 's/[^t]*$//' file. txt
Delete all spaces in front and at the end of every line of file. txt
Lernen beginnen
sed 's/^[^t]*//; s/[^]*$//' file. txt
Replace foo with bar only for the first instance in a line.
Lernen beginnen
sed 's/foo/bar/' file. txt
Replace foo with bar only for the 4th instance in a line."
Lernen beginnen
sed 's/foo/bar/4' file. txt
Replace foo with bar for all instances in a line.
Lernen beginnen
sed 's/foo/bar/g' file. txt

Sie müssen eingeloggt sein, um einen Kommentar zu schreiben.