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

rsync如何自动允许ssh密钥指纹

当我们第一次使用ssh进行主机连线时,会显示一个主机密钥的指纹确认。 有时进行一些自动化的调度使用rsync,或许远程主机变更了,需要自动允许, 如何让ssh自动允许指纹进行连线,不需使用交互模式手动去压yes呢?

linux, centos, rsnapshot

如何在CentOS 7安装rsnapshot

rsnapshot是一个采用rsync为基础的工具,他可以进行快照式的增量备份,不过我们在CentOS下了which rsnapshot怎么没有这个命令呢,用yum install rsnapshot没有辨法安装?

linux

关於setfacl

我想现在的Linux大多支持Access Control List (ACL)。在文件系统ACL激活的情况下, 我们可以设置额外的权限给不同的使用者或群组。 这让我们更加自由的来设置不同使用者的文件系统权限。 直接来看命令。