公司给的堡垒机每次登陆都要这样写ssh root@192.168.0.1,很麻烦而且很难记,并且不好配置hosts
那有没有一种简单的方法解决这个ssh问题呢
在用户家目录新建一个config文件
touch ~/.ssh/config
chmod 600 ~/.ssh/config
文件内容
Host nginx
HostName 172.16.17.6
User sadmin
Identityfile ~/.ssh/id_rsa
一定要注意对齐与公钥文件
这样把私钥推送到目标主机后,就可以用ssh nginx登陆了。
原文:https://www.cnblogs.com/sunshinea121/p/12939328.html