紀錄在 GitHub 上新增 SSH key 的方法, 省去 clone 和 push 時打密碼的麻煩.
建立 SSH keys
# Create rsa key with 4096 bits
$ ssh-keygen -t rsa -b 4096
在 ~/.ssh/config
新增 GitHub 連線資訊
Host github
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
基本上參考官網的說明就可以了
~/.ssh/id_rsa.pub
) to “Key” field.設定好後 clone / push 就不需要打密碼了. 也可以直接 clone GitHub 提供的 SSH link.
$ git clone git@github.com:borting/borting.github.io.git
GitHub
Written on
March
18th,
2021
by
Borting