console=tty0 rd.break
ctrl+x
mount -orw,remount /sysroot #以读写的方式重新挂载root的根目录
chroot /sysroot #切换到root的shell
echo 123456 | passwd --stdin root #重新设置root密码
touch /.autorelabel #创建隐藏文件重新打selinux标签
exit
exit
查看配置文件
#直接修改现有的配置⽂件
nmcli connection modify "Wired connection 1"
ipv4.addresses 172.24.10.150/24
ipv4.gateway 172.24.10.100
ipv4.dns 172.24.10.254
ipv4.method manual
connection.autoconnect yes
#激活修改后的配置⽂件
nmcli con up "Wired connection 1"
#⽅法2
#直接添加⼀个新的配置⽂件
nmcli con add con-name static ifname eth0 type ethernet
ipv4.addresses 172.24.10.150/24 ipv4.gateway
172.24.10.100 ipv4.dns 172.24.10.254
#激活添加的配置⽂件
nmcli con up static
[baseos]
name = baseos
baseurl = http://repo.domain10.example.com/rhel80/BaseOS
enable = yes
gpgcheck = 0
[appstream]
name = appstream
baseurl = http://repo.domain10.example.com/rhel80/AppStream
enable = yes
gpgcheck = 0
man semanage fcontext
# 搜索example关键词 /EXAMPLE
man semanage port
# 搜索example关键词 /EXAMPLE
setenforce 1
yum provides semanage
#policycoreutils-python-utils-2.9-9.el8.noarch : SELinux policy core python utilities
yum -y install policycoreutils-python-utils
#Package policycoreutils-python-utils-2.9-9.el8.noarch is already installed.
semanage fcontext -a -t httpd_sys_content_t "/var/www/html(/.*)?"
restorecon -RvF /var/www/html
#Relabeled /var/www/html/index.html from unconfined_u:object_r:httpd_sys_content_t:s0 to system_u:object_r:httpd_sys_content_t:s0
semanage port -a -t http_port_t -p tcp 82
semanage port -l | grep http
#http_port_t tcp 82, 80, 81, 443, 488, 8008, 8009, 8443, 9000
systemctl restart httpd
systemctl enable httpd
#Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service \u2192 /usr/lib/systemd/system/httpd.service.
curl localhost:82
#第二题的web页面
firewall-cmd --add-port=82/tcp --per
#success
firewall-cmd --reload
#success
sh-4.4# ssh root@172.24.10.201
[root@system2 ~]# curl 172.24.10.150:82
第二题的web页面
groupadd sysmgrs -g 30000
useradd