Answers:
如果您有ssh密钥的副本(例如,在USB记忆棒上),则只需将密钥文件复制到~/.ssh/
目录中即可。
例如,
cp /path/to/my/key/id_rsa ~/.ssh/id_rsa
cp /path/to/my/key/id_rsa.pub ~/.ssh/id_rsa.pub
# change permissions on file
sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa.pub
# start the ssh-agent in the background
eval $(ssh-agent -s)
# make ssh agent to actually use copied key
ssh-add ~/.ssh/id_rsa
否则,您将需要创建一个新的并将其添加到您的GitHub帐户https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/。在使用时,请确保从GitHub上删除旧密钥。