Using ssh keys to login to VMs

1. first generate a public / private key pair using ssh-keygen

    ssh-keygen -t rsa -b 4096 -C "ranjit"
      - accept the prompts
      - if needed, enter a filename - e.g rsa-mykey
      - no need of passphrase

   after the command executes, 2 files are generated:
   rsa-mykey   - this is the private key file
   rsa-mykey.pub  - this is the public key file

 2.   store the public key file to authorized_keys  :e.g cp rsa-mykey.pub ~/.ssh/authorized_keys

 3.   Use the private key file to login into the machine with tools like Putty

 4.  Putty does not accept this private key file as it is in openssh ssh-2 format. So convert to putty
       private  file format using puttygen

       a)  open puttygen
       b)  load the private key file
       c)  then save the private key file

 5.  Use the saved private key file (e.g .ppk) to login to the machine using Putty.

Comments

Post a Comment

Popular posts from this blog

Amazon Scenario Questions

Accessing NATted VMs from Host machine using Port Forwarding