在 /home/用戶/ 目錄下確認(rèn)是否存在.ssh目錄,如果已經(jīng)存在的話,再確認(rèn)該目錄下是否存在id_rsa和id_rsa.pub兩個文件。
如果有的話,直接把id_rsa.pub文件的內(nèi)容直接復(fù)制添加到Github的SSH Keys中即可。
如果沒有的話,在終端中執(zhí)行下面的命令即可生成:
ssh-keygen -t rsa -C "youremail@example.com"
如果是第一次使用的話,會得到警告,輸入yes即可。
The authenticity of host 'github.com(xx.xx.xx.xx)' can't be established.
RSA key fingerprint is xx.xx.xx.xx.
Are you sure you want to continue connecting(yes/no)?