ssh-keygen -t rsa -f ~/.ssh/id_rsa -N '' -q
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh/
chmod 600 ~/.ssh/authorized_keys
service sshd restart
vi /etc/ssh/sshd_config

# RSAAuthentication yes
# PubkeyAuthentication yes
# AuthorizedKeysFile  .ssh/authorized_keys
# PasswordAuthentication no
yum -y install policycoreutils-python
semanage port -a -t ssh_port_t -p tcp 9022
如果觉得我的文章对你有用,请随意赞赏