Rhel
Rhel
Q. Debug SE-Linux
Ans.
yum install httpd
systemctl enable httpd
sysyemctl restart httpd
semanage port -a -t http_port_t -p tcp 86
firewall-cmd --permanent --add-port=86/tcp
firewall-cmd --reload
firewall-cmd --list-all
cd /var/www/html
ls
# if there is no file
complete!!
# else ls -lZ(to check the semanage syntax)
if syntax of all files are same
complete!!
else
chcon -t <syntax of the same files> <name of different file> (to make
the sysntax same)
Q. crontab
Ans.
yum install cronie
systemctl status crond
systemctl enable crond
systemctl restart crond
useradd
crontab -e -u <user_name>
Q. ntp
Ans.
vim /etc/chrony.conf
server <link> iburst
systemctl restart chrony.conf
chronyc sources -v
Q.Tar
Ans.
tar -cvzf /root/archive.gz /etc
Q. find user
Ans.
mkdir /root/found
find / -user <user_name> -exec -cp -rvf {} /root/found \;
vim /etc/auto.misc
<location> -rw,soft,intr <given_ip>:<location>
Q. sudo privilage
Ans.
vim /etc/sudoers.d/<group_name>
%<group_name> ALL=(ALL) NOPASSWD:ALL
Q. umask
Ans.
useradd alexa
passwd alexa
su - alexa
vim .bashrc
umask 0222
useradd user1
cd /home/user1
mkdir .testapp
cd .testapp
vim testapp.conf
"Welcome to uer1"
cd
chmod a+x /usr/sbin/testapp
Q. environmental variable
vim .bashrc
path=<given_path>
path=
Q.
Ans.