Published - 6 years ago ( Updated - 6 years ago )
When we use ssh public key authentication, we usually add relevant settings in ~/.ssh/config.
If some are used by the company or at home, can multiple configs be used?
In fact, it is possible. We can use git to load the company-shared, version-controlled config through Include.
The following is a schematic setting of ~/.ssh/config.
If some are used by the company or at home, can multiple configs be used?
In fact, it is possible. We can use git to load the company-shared, version-controlled config through Include.
The following is a schematic setting of ~/.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
Keep Alive 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
No Comment
Post your comment