github 配置#
切到 .ssh 目錄#
cd ~/.ssh
生成密鑰#
ssh-keygen -t rsa -C "[email protected]" -f id_github_rsa
建立 config 檔案#
用來管理不同來源的密鑰
touch config
填入以下內容:
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_github_rsa
添加 ssh key#
打開官網,複製 id_github_rsa.pub
內容,添加 ssh key
加入 ssh-agent#
ssh-add ~/.ssh/id_github_rsa
測試#
ssh -T [email protected]
huggingface 配置#
生成密鑰#
ssh-keygen -t ed25519 -C "[email protected]" -f id_huggingface_rsa
修改 config#
Host huggingface.co
HostName huggingface.co
User git
IdentityFile ~/.ssh/id_huggingface_rsa
添加 ssh key#
打開官網,複製 id_huggingface_rsa.pub
內容,添加 ssh key
加入 ssh-agent#
ssh-add ~/.ssh/id_huggingface_rsa
測試#
$ ssh -T [email protected]