2016-10-25 157 views
0

我对SSH等知之甚少。我试图在Github上添加新的SSH密钥。为此,我遵循这个过程:Github:新的SSH密钥

在终端

[email protected]:~$ ssh-keygen -t rsa 
Generating public/private rsa key pair. 
Enter file in which to save the key (/home/work/.ssh/id_rsa): 
Created directory '/home/work/.ssh'. 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/work/.ssh/id_rsa. 
Your public key has been saved in /home/work/.ssh/id_rsa.pub. 

然后是密钥指纹关键的randomart图像

在浏览器

我开了:

Github >> Settings >> SSH and GPG keys >> New SSH key

它要求标题重点。我给了一些标题,然后我在那里复制了我的钥匙id_rsa.pub。它给出了一个错误:

Key is invalid. It must begin with 'ssh-ed25519', 'ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'. Check that you're copying the public half of the key

我不知道如何进一步进行。请告诉我我错在哪里,或者指导我一个很好的教程。

OS细节:Ubuntu的14.04.5

谢谢!

PS:我想了解“密钥指纹”和“关键的randomart形象”在互联网上,但一切都在我头上

回答

1

你确定你完全复制你的公钥?

执行

cat /home/work/.ssh/id_rsa.pub

,一切复制到剪贴板。

您也可以尝试用XCLIP:

xclip -sel clip < /home/work/.ssh/id_rsa.pub

+0

唷!这是我的错误。在复制密钥时,我正在离开'工作@ Nirvair'。我注意到我没有像所说的那样复制**所有内容。非常感谢! – ssokhey