Osiemnaste_21

 0    21 fiche    michalesq
Imprimer jouer consultez
 
question - réponse -
list all available contexts existing in the system and files associated with them
commencer à apprendre
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
commencer à apprendre
(/.*)?
restore context of the parent directory to the content
commencer à apprendre
restorecon index. html
which file has to exist to relabel files in the system
commencer à apprendre
/.autorelabel
How to apply context to the firectory?
commencer à apprendre
semanage fcontex -a -t <context_t> '<directory(/.*)?>'
restoring content recursively, verbosely
commencer à apprendre
restorecon -Rv /content
How to remove context?
commencer à apprendre
seamange fcontex -d "<directory(/.*)?>"
display boolean values
commencer à apprendre
getsebool -a / semanage boolean -t
enables homedirs in SELinux (not persistent)
commencer à apprendre
setsebool httpd_enable_homedirs on
enables homedirs in SELinux (persistent)
commencer à apprendre
setsebool -P httpd_enable_homedirs
How to install troubleshooter for selinux?
commencer à apprendre
yum install setroubleshoot-server
which file contains information about SELinux violations?
commencer à apprendre
/var/log/audit/audit.log
How to run troubleshooter?
commencer à apprendre
sealert -a /var/log/audit/audit. log
" Replaces one with unos in a case-insensitive manner, so it will print ""unos TWO"""
commencer à apprendre
echo ONE TWO | sed "s/one/unos/I"
A way to replace dos2unix:)
commencer à apprendre
sed 'G; G' file. txt
Delete all spaces in front of every line of file. txt
commencer à apprendre
sed 's/^[^t]*//' file. txt
Delete all spaces at the end of every line of file. txt
commencer à apprendre
sed 's/[^t]*$//' file. txt
Delete all spaces in front and at the end of every line of file. txt
commencer à apprendre
sed 's/^[^t]*//; s/[^]*$//' file. txt
Replace foo with bar only for the first instance in a line.
commencer à apprendre
sed 's/foo/bar/' file. txt
Replace foo with bar only for the 4th instance in a line."
commencer à apprendre
sed 's/foo/bar/4' file. txt
Replace foo with bar for all instances in a line.
commencer à apprendre
sed 's/foo/bar/g' file. txt

Vous devez vous connecter pour poster un commentaire.