ssh无密码认证
1.ssh-keygen #客户端生成公钥和私钥,保存到/root/.ssh/
ssh-copy-id -i id_rsa.pub [email protected]@服务端ip #发送公钥给服务端
#服务端生成authorized_keys
ssh [email protected]服务端ip #测试连接
2.ssh-keygen #服务端生成公钥和私钥,保存到/root/.ssh/
ssh-copy-id -i id_rsa.pub [email protected]@服务端ip #发送公钥给服务端自己
ssh-copy-id -i id_rsa [email protected]@服务端ip #发送私钥给客户端
ssh [email protected]服务端ip #测试连接
时间: 2024-10-16 09:20:08