Ubuntu 14.04 生成ssh秘钥

不积跬步无以至千里

由于换了台电脑,需要重新配置一下ssh秘钥,下满写下来,做个笔记。

1、进入终端

执行命令:

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

邮箱填写成自己的工作邮箱地址,执行后,终端会出现如下等提示:

Generating public/private rsa key pair.

Enter file in which to save the key (/home/wangdongyu/.ssh/id_rsa):

Created directory '/home/wangdongyu/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/.ssh/id_rsa.
Your public key has been saved in /home/.ssh/id_rsa.pub.
The key fingerprint is:
85:60:59:1a:77:45:22:b9:56:c0:10:4e:6f:9f:6f:c8 ×××××.com.cn

这里会生成一个隐藏文件 .ssh,因为我是在这个/home/wangdongyu路径下执行的命令,因此隐藏文件会生成在这个目录下

2.生成的文件

如上粘贴,会提示你生成.ssh的路径,以及里面会生成两个文件为id_rsa和id_rsa.pub,这里前者会秘钥,后者为公钥。

3.配置公钥

公钥用来配置git等等里,打开公钥文件并复制到需要填写的地方。


猜你喜欢

转载自blog.csdn.net/wdyshowtime/article/details/80846977