ssh登陆不需要密码

ssh-keygen -t rsa

一直按enter

chmod 0700 /root/.ssh

chmod 0600 /root/.ssh/*

scp -P 22 /root/.ssh/id_rsa.pub [email protected]:.ssh/

输入密码

上传后

ssh -p 22 [email protected]

输入密码登陆

chmod 0700 /root/.ssh

cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized.key

chmod 0600 /root/.ssh/authorized.key

exit


最后ssh -p 22 [email protected]    或者  ssh -p 22 [email protected] -i /root/.ssh/id_rsa


你可能感兴趣的:(ssh登陆不需要密码)