ssh免密码登录

最近用SSH的地方变多了,每次去想/复制密码也挺麻烦的,特别是对于我这样的懒人。虽然早就知道可以免密码登录,不过也是因为太懒,一直没去弄:p

首先,在本地的机器上执行ssh-keygen -t rsa

然后再cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"

把公匙复制到远程的机器上。

这样就完成了,最后可以稍微优化一下的就是在连接时使用:

ssh -4 -C -c blowfish-cbc user@machine

强制使用IPv4,压缩数据流,使用Blowfish加密。

Leave a Reply

Your email address will not be published. Required fields are marked *

13 − four =