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, python, colab

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

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

linux

haproxy 1.8.9编译日志

日志在Ubuntu下编译haproxy 1.8.9过程。

Laravel linux

我的移动电脑,安装Laravel 8在Sony xperia 5 II上

这是我的第一只Android手机,试装Laravel完全没问题耶,基本上我装了vim及mariadb。 运行sshd后,可以透过8022登录哦,完全是一台移动电脑了:p。 我使用的软体是Termux...