/ Engineering

Using ssh from bash, windows

Windows uses putty for generating public key and private key wherever an ssh login is required.

Now that we have bash for windows, naturally, users would want to login from bash using the same private key. The problem here is putty generates ppk files in the location chosen by user, while ssh expects private key in ~/.ssh files. Without going deep, basic directions of what to do:

  1. Open putty and load key.
  2. Once the desired key is loaded, go to conversions --> Export Openssh key
  3. Save the ssh key in home folder/.ssh (please not this might not be visible if you've hidden files) with the name id_rsa( something like C:/Users/username/.ssh/id_rsa)
  4. If all is working good, you should be able to login as
    ssh [email protected]_address

If you choose to save this file with any other name than id_rsa, you need to do ssh -i .ssh/filename [email protected]_address each time you use or run ssh-add .ssh/filename

Also read: https://acsrujan.net/ssh-public-key-for-lifetime/