I'm following #335 Deploying to a VPS , and near the end of the episode, we need to run ssh-add
to give server access to github repo.
The problem is how do I run it in windows? What need to install?
I know that to run ssh
to access the remote server, I can use Putty
. But this command needs to run locally, I do know how to use Putty
to do this.
If you are trying to setup a key for using git with ssh, there's always an option to add a configuration for the identity file.
Make sure you have Git installed and have git's
cmd
folder in your PATH. For example, on my computer the path to git's cmd folder isC:\Program Files\Git\cmd
Make sure your
id_rsa
file is in the folderc:\users\yourusername\.ssh
Restart your command prompt if you haven't already, and then run
start-ssh-agent
. It will find yourid_rsa
and prompt you for the passphraseEdit: It looks like
start-ssh-agent
doesn't work correctly if you're using PowerShell. If you use PowerShell and Git, you could install posh-git. It comes with a cmdlet calledStart-SSHAgent
which achieves the same outcome asstart-ssh-agent
.ssh-add is the command to add a key to a local agent. Putty has it's own agent program called pageant, which serves the same function.
One could install Git for Windows and subsequently run
ssh-add
:Step 3: Add your key to the ssh-agent
In order to run
ssh-add
on Windows one could install git usingchoco install git
. Thessh-add
command is recognized onceC:\Program Files\Git\usr\bin
has been added as a PATH variable and the command prompt has been restarted: