简体   繁体   中英

how to generate a ssh key in windows?

I'm following this to generate a ssh key on windows 8.1, but if I press enter key when asked to enter file in which to save the key I get error could not create the directory '//.ssh'

now if instead of pressing enter I enter "id_rsa", then after doing clip < ~/.ssh/id_rsa.pub , I get The system cannot find the path specified .

Is there any way around this? I can switch to ubuntu but I want to do this on windows.

The best way to find your ssh keys is:

  1. create an account in Github
  2. download Github application on desktop and login with your credentials
  3. after 1 min, Go to Github website --> login --> go to setting --> In left side click on ssh keys, here you can find your ssh keys.
could not create the directory '//.ssh'

That means $HOME isn't properly defined. Try and type first:

export HOME=/c/Users/<yourUsername>

Then ssh-keygen -t rsa -C "$your_email" should work.

Note that if you were to type the same command in a (DOS) shell launched with the git-cmd.bat included in a standard Git for Windows (msysgit) , %HOME% wold be set for you (to %USERPROFILE% ), and the same ssh-keygen -t rsa -C "$your_email" would work too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM