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

ps aux你會了嗎?

對於Linux的系統管理者來說肯定要看懂ps aux指令,如果你想成為一個Linux系統管理者,或是你是一個Linux的使用者,都應該都要看的懂這個指令ps就是process status的簡稱,系統上跑了什麼樣的程式,狀態如何執行的身份是誰都可以透過這個指令查出來。看到一些不該出現的程式,可能系統被入侵,被來挖礦了🥹

linux,raspberry

樹莓派安裝VNC Server

檢單介紹如何在樹莓派上啟動VNC Server

linux, mac, terminal, tips

再Linux或Mac的終端機如何清除目前的命令列的輸入?

再Linux或Mac的終端機如何清除目前的命令列? 例如打錯了一堆指令,打錯了想清除從打, 千萬要跟我以前一樣,用倒退鍵慢慢殺了,我們可以用......