by Devin Yang

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

我们使用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,raspberry

树莓派安装VNC Server

检单介绍如何在树莓派上启动VNC Server

linux

如何检查apache加载并激活了那些modules?

如何检查apache加载并激活了那些modules?

linux,cli

如何用date命令,显示昨天的日期

在MacOS或Linux上命令是不同的,但是可以达到相同的效果。 我们来看看如何用date命令显示昨天的日期。