ssh的简单用法

公司给的堡垒机每次登陆都要这样写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登陆了。

posted @ 2020-05-22 19:32  大小狮子  阅读(139)  评论(0编辑  收藏  举报