Osiemnaste_21

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

您必须登录才能发表评论。