1、生成ssh-key
針對不同的git地址,生成不同名稱的的rsa檔案
ssh-keygen -t rsa -C "lycdangweijun104@163.com" -f ~/.ssh/xiangxindai-rsa
2、在~/.ssh目錄下添加config組態檔用于區分多個SSH-Key
# 第一個Git配置
Host git.xs.jf
HostName git.xs.jf
PreferredAuthentications publickey
IdentityFile ~/.ssh/sanwenqian-rsa
# 組態檔引數說明
# Host: Host可以看作是一個你要識別的模式,對識別的模式,進行配置對應的的主機名和ssh檔案
# HostName: 要登錄主機的主機名
# User: 登錄名
# IdentityFile: 指明上面User對應的identityFile路徑
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/299439.html
標籤:其他
