ubuntu 如何生成秘钥(ssh key)

ubuntu 如何生成ssh key以及如何查看ssh key
1.检查本地是否有SSH Key存在
在终端输入

ls -al ~/.ssh

2.如果输出的是:

No such file or directory

3.那就没有ssh key
如果有就会出现这样:生成新的SSH key
4.首先在终端输入

ssh-keygen -t rsa -C "[email protected]"

5.之后一路回车键(Enter),就生成了;

Generating public/private rsa key pair.
Enter file in which to save the key (/home/your_email/.ssh/id_rsa): 
Created directory '/home/your_email/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 

Your identification has been saved in /home/your_email/.ssh/id_rsa.
Your public key has been saved in /home/your_email/.ssh/id_rsa.pub.
The key fingerprint is:

85:60:59:1a:77:45:22:b5:56:c1:10:4e:1f:9f:6f:c8 [email protected]
The key's randomart image is:
|**生成的图+

6.最后生成的秘钥在/home/use/生成一个隐藏文件.ssh,打开隐藏文件,进去两个文件id_rsa 和 id_rsa.pub,
id_rsa.pub是你的公钥,把这个添加进你所工作的项目中就可以使用了;

猜你喜欢

转载自blog.csdn.net/xiao_yuanjl/article/details/80846108