by Devin Yang

建立於: 8年前 ( 更新: 8年前 )

我們使用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

rsync如何自動允許ssh金鑰指紋

當我們第一次使用ssh進行主機連線時,會顯示一個主機金鑰的指紋確認。 有時進行一些自動化的排程使用rsync,或許遠端主機變更了,需要自動允許, 如何讓ssh自動允許指紋進行連線,不需使用互動模式手動去壓yes呢?

linux

舊版CentOS 6.2編譯git過程

本文使用的CentOS 6.2進行,進行重build curl及git過程。 主因是因為作業系統太舊,我直接由source build最新版本的git。

linux,cli

如何用date指令,顯示昨天的日期

在MacOS或Linux上指令是不同的,但是可以達到相同的效果。 我們來看看如何用date指令顯示昨天的日期。