附加项-linux下ssh的config文件讲解-闫刚

在~/.ssh/ 下创建 config文件,可以添加多个账号,减少认证的问题, 并以如下格式编辑配置文件

$ vi. config

#HostName: 是目标主机的主机名,也就是平时我们使用ssh后面跟的地址名称。

#Port:指定的端口号。

#User:指定的登陆用户名。

#IdentifyFile:指定的私钥地址

#
#  下面是登录github的脚本
#  example: git clone yangang123:yangang123/cpp_test.git
#  替换之前的git clone [email protected]:yangang123/cpp_test.git用法
#
host yangang123
    user git
    hostname github.com
    port 22
    identityfile /home/yangang/.ssh/id_rsa
用名字代替之前那ip地址

猜你喜欢

转载自blog.csdn.net/yangang185/article/details/79861364