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
如果私钥不在默认位置,可以通过-i 参数指定,比如:
ssh -p 22 -i /root/wb31x7fc0a.private root@39.106.160.108
这里通过 -i 指定私钥路径为:/root/wb31x7fc0a.private
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!