Siedemnaste_21

 0    21 flashcards    michalesq
print play test yourself
 
Question - Answer -
Delete the last line
start learning
sed '$d' file. txt
Print only lines with three consecutive digits
start learning
sed '/[0-9]\{3\}/p' file. txt
Unless boom is found replace aaa with bb
start learning
sed '/boom/! s/aaa/bb/' file. txt
Delete all lines from line 17 to 'disk'
start learning
sed '17,/disk/d' file. txt
How to install software for firewall and firewall-conf
start learning
yum install firewall firewall-config
Display firewall zones
start learning
firewall-cmd --get-zones
Display display default zone
start learning
firewall-cmd --get-default-zone
List services in default zone (public)
start learning
firewall-cmd --list-all
List services in home zone
start learning
firewall-cmd --zone=home --list-all
Not persistently add source IP to zone home, all services will be allowed for this source (disappaear after a reload/restart)
start learning
firewall-cmd --zone=home --add-source=192.168.1.0/24
How to reload firewalld
start learning
firewall-cmd --reload
Persistently add source IP to zone home, all services will be allowed for this source (needs reload/restart to appear)
start learning
firewall-cmd --zone=home -- permanent --add-source=192.168.1.0/24
Not persistently add port 80/tcp to zone public
start learning
firewall-cmd --zone=public --add-port=80/tcp
Persistently add port 80/tcp to zone public
start learning
firewall-cmd --zone=public --permanent --add-port=80/tcp
opens a GUI firewall config if you use graphical interface
start learning
firewall-config
how to generate public and private key for authentication
start learning
ssh-keygen -t rsa
display state of selinux
start learning
getenforce
changing state to permissive
start learning
setenforce 0
changing state to enforcing
start learning
setenforce 1
disable selinux
start learning
/etc/selinux/config SELINUX=disabled
Display full SElinux context (user, role and type)
start learning
ls -Z

You must sign in to write a comment