by Devin Yang

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

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

如何建ssh金鑰,讓自己的電腦可以連到 GCE的instance

最近剛好開始使用Google的GCE,記錄一下Goolge官方的說明文件,如何產生金鑰給instance使用。 這裡的-C comment會用登入使用者的名稱,另外-t使用rsa。

linux,docker,wifi

用docker建立WPA2/EAP企業用Radius驗證伺服器,後端使用mysql資料庫

AP提供了WPA2/EAP功能,但不會用嗎? 本文介紹我如何透過docker的ubuntu:21.04 image,極速建立Radius伺服器, 與Wifi的WPA2/EAP等相關運用。

linux, centos, rsnapshot

如何在CentOS 7安裝rsnapshot

rsnapshot是一個採用rsync為基礎的工具,他可以進行快照式的增量備份,不過我們在CentOS下了which rsnapshot怎麼沒有這個指令呢,用yum install rsnapshot沒有辨法安裝?