As we know ssh allow authentication using private/public key. Today i was accessing my linux system from windows by giving username and password and i decided to access using key. I followed following steps for that ,As we know putty is most popular windows ssh client. First of all i downloaded puTTygen and putty software from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Then i executed puttygen to generate private and public keys . I saved my public key file as vishesh.pub and private key file as vishesh.ppk.
Now public file has to be transferred on linux system, after transfer i written following line on linux system to import public key into authorized key
root#ssh-keygen -i -f vishesh.pub >>/root/.ssh/authorized_key
Now my ssh server is ready to accept private key for authentication.
Finally i executed putty and specify following parameters
IP address of linux box
default userrname as 'root'
and location of private key file.
And linux box get connected without asking password
Now public file has to be transferred on linux system, after transfer i written following line on linux system to import public key into authorized key
root#ssh-keygen -i -f vishesh.pub >>/root/.ssh/authorized_key
Now my ssh server is ready to accept private key for authentication.
Finally i executed putty and specify following parameters
IP address of linux box
default userrname as 'root'
and location of private key file.
And linux box get connected without asking password