by Devin Yang
(This article was automatically translated.)

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.
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

Tags: linux

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


linux,config

Ubuntu ppp0 renamed eth0

Not sure who will use it, but I encountered it myself, because my home is a floating IP. A software I installed cannot detect that the ppp0 network card is an external network, so changing the name can trick him into successfully installing it.

php,linux

WebShell Function Introduction and Precautions

I suddenly wanted to introduce what is WebShell, so I found one on the Internet. Its functions are quite good. But I still wanted some features, so I spent three nights making some small optimizations for him. If you haven't heard of WebShell yet, take a look at this video. If you like my optimized version, please give me a like, thank you.

linux, centos, rsnapshot

How to install rsnapshot on CentOS 7

rsnapshot is a rsync-based tool that can perform snapshot incremental backups. However, we installed which rsnapshot in CentOS. Why is there no such command? There is no way to install it with yum install rsnapshot?