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,system

檢測系統中的selinux是否啟用

檢測系統中的selinux是否啟用

linux

關於setfacl

我想現在的Linux大多支援Access Control List (ACL)。在檔案系統ACL啟用的情況下, 我們可以設定額外的權限給不同的使用者或群組。 這讓我們更加自由的來設定不同使用者的檔案系統權限。 直接來看命令。

linux,security

ssh-agent及ssh-add認證代理員

在ssh的核心套件中的程式諸如,scp、ssh、ssh-add、ssh-agent、sshd及ssh-keygen 讓我們來談談ssh-agent及ssh-add使用情境吧。 在開始前先來看看這些指令用途的簡介: