As the server passwords comprise of rather painful combination of characters, I often find it annoying to type the password every-time I ssh to a remote server. This annoyance turned into a marked irritation when RapidSVN on Ubuntu 11.10 prompted for password every-time I tried to update, commit or add a file to the repository. As a workaround I was aware that I could use my public key but I wasn't quite aware on how to do it. Apparently it turned out to be a quite straightforward.
Note: You should have a ssh client installed - Ubuntu has it by default
Step 1: Generate rsa key pair (private/public) in your local machine.
Step 2: Login to the remote server using whichever the method you used earlier to create a directory ~/.ssh if the directory doesn't already exist.
Step 3: Now that you have create the directory exit from the remote server and append your public key to the 'authorized_keys' list in the remote server.
Step 4: Done. Now if you use the login command in Step 2, you won't be prompted for your password.
RSA is a private/public key encryption algorithm where the public key is "public" - known to everyone (remote server in this case). Your local machine would use this public key to encrypt ssh
messages.
Finally, RSA is a public-key cryptographic technique where the messages encrypted via the private key can only be decrypted via the public key and the messages encrypted via the public key can only be decrypted via the private key. i.e. not the same key is used for encryption and decryption.
Comments
Post a Comment