by Devin Yang

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

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

如何用find命令,找7天内变动过的文件

如果我们变更过一些文件,如何透过命令行找出来呢?

linux

加载.env的环境变量到系统上

加载.env的环境变量到系统上

linux, python, colab

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

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