ssh使用公钥登录客户端设置

ssh使用公钥登录客户端设置

   先  ssh-keygen 生成一对密钥  然后将 公钥上传到服务器 然后 cat xx.pub >> .ssh/authorized_keys

   然后 客户端 怎么让 ssh 登录的时候 知道要使用哪个 私钥呢 。。。

  编辑 .ssh/config

host 69.11.11.252

user git

hostname server

port 22

identityfile ~/.ssh/admin

其实只需要指定  host user 还有最后的私钥就行了。。。

原文地址:https://www.cnblogs.com/www886/p/4233309.html