0
点赞
收藏
分享

微信扫一扫

linux ssh 连接某个主机时,指定私钥的路径

ZMXQQ233 2022-02-10 阅读 53

1.修改当前登录用户的 ssh 环境变量文件(没有则新增)

vim ~/.ssh/config

2.根据需求,定义需要连接的主机的私钥路径(可以定义多个不同的主机)

Host github.com
  User git
  Hostname github.com
  IdentityFile ~/data/.ssh/git_id_rsa

Host 172.16.3.25
  User lowman
  Hostname 172.16.3.25
  IdentityFile ~/data/.ssh/my_id_rsa
举报

相关推荐

0 条评论