by Devin Yang

建立于: 7年前 ( 更新: 7年前 )

我们使用ssh公钥验证时,通常会在~/.ssh/config添加相关设置。
如果说有些是公司用的或是家里用的,是否可以使用多个config呢?
其实可以的,我们能git透过Include加载公司共用,有版本控制的config。

以下是~/.ssh/config的示意设置。
Include ~/.ssh/keys/office_config

#Ha Backup
Host habackup
Hostname 172.16.1.10
User git
StrictHostKeyChecking no
IdentityFile=~/.ssh/id_rsa

#gogs
Host gogs
Hostname 172.16.1.13
User git
KeepAlive yes
ServerAliveInterval 30
StrictHostKeyChecking no
IdentityFile=~/.ssh/id_rsa
Port 10022

Host cc
Hostname 192.168.100.1
User root
IdentityFile=~/.ssh/id_rsa
Port 2222

Host ccc
Hostname 35.194.181.21
User devin_yang
IdentityFile=~/.ssh/ccc-gcp

#GitLab
Host gitlab.com
Hostname gitlab.com
User git
IdentityFile=~/.ssh/id_rsa_gitlab

Tags: linux

Devin Yang

文章内容无法一一说明,如果您有什么不了解处,欢印提问哦:)

No Comment

Post your comment

需要登入才可留言!

类似文章


linux,system

检测系统中的selinux是否激活

检测系统中的selinux是否激活

php,linux

WebShell功能介绍及注意事项

突然想来介绍什么是WebShell就上网找了一个,他的功能已相当好了, 不过我还想要一些功能,於是就用了三个晚上的时间,替他进行了一些小小的优化。 如果,您还没听过WebShell,快来看看这个影片吧。 如果您喜爱我的优化版本,请给我个赞哦,谢谢啦。

linux, python, colab

如何从我们的Server透过ssh连线到colab?

介绍我写的一支bash,用来透过ssh连线到colab vm内。 一行命令,搞定colab OpenSSH Server。