Most of the time I need to login to my linux box in my office from home. The obvious choice is to ssh using putty or cygwin (in case i need some X windows). Normally in cygwin – you will run
ssh -l xyz@yourserver.com ………(1)
to login to your account “xyz” in yourserver.com . This would ask for password and if you provide the correct password you would be able to login to the server.
SSH optionally uses public-key encryption – where a public and private key pair can be used to automate the login process. If you are using cygwin( or in fact any other client running ssh) you can do the following to generate your public and private key pair
ssh-keygen…………………………..(2)
It will prompt for a few input – but you can just press ‘enter’ in all the cases. The keys will be created in $HOME/.ssh/as id_rsa(private key) and id_rsa.pub(public key). Now you can copy the id_rsa.pub to the server -yourserver.com’s ‘xyz’s ~/.ssh/ as ‘authorized_keys’ – and you are done. Try running (1) and you should be able to login without the prompt for password.
In case you are using putty – you can use puttygen to generate the public & private key pair. Then you will do the same step – copy the public key to the desired account’s .ssh/authorized_keys and use the private key to login. There are tutorials that explains this with nice diagrams .
Comments