修改/etc/ssh/sshd_config文件 以下任一修改必须重启sshd服务 systemctl restart sshd
禁用密码登录修改PasswordAuthentication属性:将yes修改为no
修改端口 提醒修改端口必须关闭selinuxPort 22
启用root登录PermitRootLogin yes
启用密钥登录PubkeyAuthentication yes
密钥文件路径AuthorizedKeysFile .ssh/authorized_keys
公钥内容ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAtqjV8b5IveNRs4Vdp5tQvBtqcSJXA6VED6ml6m3xmd8VOXWL2Fbf61wDr1IKIDOMToBRNzR6D8sXr0R0P+MgTNoYw7zTjQAJUr+ABQeXiq1ebJ4PMlfu5sl5WpjT7Y/HGVR1A7vofTWL7F0bv9wSPGBWiM3q3cK/TRN2YeMs8is=