我在我的机器上安装了全新的Ubuntu 16.04。
现在我想要使用我现有的SSH密钥,这样我就可以在GitHub上继续使用之前的活动。
我该如何设置这个?
我该如何设置这个?
~/.ssh/
目录即可。
E.g.,
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
步骤1:授予ssh文件夹权限
chmod 700 ~/.ssh
步骤2:授予ssh密钥文件权限
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
步骤3:在客户端机器上运行以下命令,将SSH密钥添加到代理程序中。
ssh-add
现在您可以使用ssh-add -l
(再次在客户端上)确认它确实已添加。
chmod 600 id_rsa*
直接复制粘贴文件的默认权限是不起作用的。 - Strixy