Windows 10, 8.1, and 7: Git for Windows. The easiest way to install Git and the SSH client on Windows 8.1 and Windows 7 is Git for Windows. It provides a Bash emulation (Git Bash) used for running Git from the command line and the ssh-keygen command that is useful to create SSH keys as you’ll learn below. If you are using the Git Shell that's installed with GitHub Desktop, the ssh-agent should be running. If you are using another terminal prompt, such as Git for Windows, you can use the 'Auto-launching the ssh-agent' instructions in 'Working with SSH key passphrases', or start it manually: # start the ssh-agent in the background $ eval $(ssh-agent -s) Agent pid 59566; Add your SSH private key to the ssh-agent. Add the following text to.ssh/config (.ssh should be found in the root of your user home folder): Enable SSH Agent Startup Whenever Git Bash is Started. First, ensure that following lines are added to.bashprofile, which should be found in your root user home folder: test -f /.profile &&. Set up SSH for Git on Windows Use this section to create a default identity and SSH key when you're using Git on Windows. By default, the system adds keys for all identities to the /Users//.ssh directory. Installing SSH keys on Windows. OpenSSH and PuTTY are free implementations of Telnet and SSH for Windows. They encrypt all traffic and provide secure communication with your remote Git repositories by using SSH keys. We recommend OpenSSH over PuTTY, and it’s installed with your Git copy.
I am trying to generate a new SSH key on my windows computer using command prompt.I have installed Cygwin and added its path to use linux commands through command prompt.
Now ls is listing me the inner folders.But ssh is still nor working.
On trying to generate SSH key using the commandssh-keygen -t rsa -C 'email_id'
its giving me a following error.ssh-keygen is not recognized as an internal or external command, operable program or batch file.
1 Answer
No need for cygwin: a regular msysgit is enough (unzip PortableGit-1.9.5-preview20141217.7z
anywhere you want, add its bin/
folder to your path and you have git
and ssh including ssh-keygen
)
Once you have launched its git-cmd.bat
, you can generate your ssh keys.
(here I don't use a passphrase, for testing purposes, avoiding the ssh-agent management)
Ssh Key Windows Gitlab
id_rsa
and id_rsa.pub
will be generated in %HOME%/.ssh
.HOME
is set by the git-cmd.bat
, usually in %USERPROFILE%
.
Not the answer you're looking for? Browse other questions tagged gitsshwindows-8 or ask your own question.
I downloaded and installed git from: https://git-scm.com/downloads. I can use git on Windows Command Prompt now.
I downloaded puttygen and used it to generate a pair of RSA keys, stored at D:rsa_keys
I added the public key to my company's git website.
Now, how can I tell git to use the rsa key I just created?
mommomonthewindmommomonthewindGenerate Ssh Key Windows Github
1 Answer
I think you may need to run git bash and set keys there:
- Start git bash (the simplest way:
All Programs -> Git -> Git Bash
- In the git bash terminal type
ssh-keygen -t rsa
. This will generate public and private key pair - Go to the location of the keys (I'd recommend using git bash for it) and open the public key (with cat, for example), copy it
- Paste the public key on your github account using
Account->SSH Keys->Add key
I hope this helps.