查看电脑是否存在id_rsa.pub cd ~/.ssh 如果不存在则会提示No such file or directory 否则会自动进入目录,用ls就可以看到 ls id_rsa id_rsa.pub
创建一个SSH key
1 2 3 4 5 6 7 8 9 10 11 12 13
ssh-keygen -t rsa -C "your_email@example.com" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/user/.ssh/id_rsa)://可以指定⽬ 录也可以不指定⽬录。直接回⻋ Enter passphrase (empty for no passphrase): Enter same passphrase again://可以不输⼊密码,直接回⻋,以后每次push就不⽤输⼊密码 Your identification has been saved in /c/Users/user/.ssh/id_rsa. Your public key has been saved in /c/Users/user/.ssh/id_rsa.pub. The key fingerprint is: 这⾥是⽣成的key fingerprint The key's randomart image is: 这⾥是⽣成的key's randomart image 此时创建ssh成功