/etc/ssh/sshd_config
PasswordAuthentication 使用密钥验证
PermitRootLogin 允许root用户登录
1、 Server:公钥 Client:私钥
2、 Server:禁止使用密钥验证
测试:Client→Server
Server:
1、ssh-keygen 生成密钥对: id_rsa (私钥) id_rsa.pub(公钥)
mvid_rsa.pub authorized_keys
scpid_rsa root@192.168.1.112:/root/.ssh (把私钥放在客户端指定路径下)
2、改配置文件: /etc/ssh/sshd_config PasswordAuthentication yes→no
3、service sshd restart
Client:
ssh 192.168.1.111