生成git公钥私钥

cd ~/.ssh

若是能进入到.ssh文件目录下 ,则证实,以前生成过.ssh秘钥,能够直接使用里面的秘钥。
若是不能进入到.ssh文件目录下,则:
检测下本身以前有没有配置:git config user.name和git config user.email(直接分别输入这两个命令)php

1、若是以前没有配置过
1.配置 git

git config --global user.name 'llh'
 git config --global user.email '956732806@qq.com'

2.生成秘钥 web

ssh-keygen -t rsa -C ‘上面的邮箱’
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/llh/.ssh/id_rsa):(位置)
Enter passphrase (empty for no passphrase):(私钥密码)
Enter same passphrase again:(确认密码)

3,而后本地电脑C盘用户目录下的.ssh文件夹下,发现已经生成了2个文件
id_rsa私钥
id_rsa.pub公钥bash