- Git Bash
- VPS to put the generated private key
- Open your git bash
cd /c/Program Files/Git/etc/ssh
- run
ssh-keygen
, name your key (id_rsa is default) then enter enter.. - copy the contents of file with
.pub
- Login on your vps via console (in case for me digital ocean console), and paste the
.pub
contents to a fileauthorized_keys
in~/.ssh/
- Save. (For me my editor is vim so i use the command
sudo vi ~/.ssh/authorized_keys
)
- Your generated pub key and private key should be in
/c/Program Files/Git/etc/ssh
. Copy folder contents inc:/.ssh/
. Make a folder if it doesn't exist - Paste in the file
ssh_config
atProgram Files/Git/etc/ssh
Host hello
HostName example.com
IdentityFile /c/.ssh/blahblah_rsa
AddKeysToAgent yes
- That way, you can run
ssh username@hello
and it will work