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.
content_copyInclude ~/.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

Remove the Linux Kernel that is not used by the old version on Ubuntu

This page describes how I removed the old version of Linux Kernel taking up space on ubuntu.

linux

Load the environment variables of .env to the system

Load the environment variables of .env to the system

linux

How to install the monitor tool htop on CentOS

Htop is a free (GPL) ncurses-based program monitor tool for Linux. It is similar to top, but allows you to scroll vertically and horizontally, so you can see the full command line running on the system, And you can view them as program trees, select multiple programs and operate them.

In order to provide you with better services, this website uses cookies. By continuing to browse the web, you agree to our cookies policy. To understanding