sshd

sshd

rockey9 开root访问:

sed -i.bak -E 's/^#?PermitRootLogin[[:space:]]+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i.bak -E 's/^#?Port[[:space:]]+[0-9]+/Port 5008/' /etc/ssh/sshd_config
dnf install -y policycoreutils-python-utils
semanage port -l | grep ssh
semanage port -a -t ssh_port_t -p tcp 5008
semanage port -l | grep ssh
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
systemctl stop firewalld
systemctl status firewalld
systemctl restart sshd
systemctl status sshd
history -c

igozhang 2021