The option -y outputs the public key. As a side note, the comment of the public key is lost. I've had a site which required the comment (Launchpad?), so you need to edit. and append a comment to the first line with a space between the comment and key data. An example public key is shown truncated below. For keys that were added to the SSH Agent (a program that runs in the background and avoids the need for re-entering the keyfile passphrase over and over again), you can use the ssh-add -L command to list the public keys for keys that were added to the agent (via ssh-add -l ). This is useful when the SSH key is stored on a smartcard (and access to the private key file is not possible. answered Jul 18 '11 at 10:12. Solution is specifically for users using Windows to SSH into their remote machines including cloud images on AWS and GCE. (If this works for you, an upvote is highly appreciated. Thanks for your patience. Recently used this solution to remote login new deployed vm images on GCE. Steps to perform. Generate public/private key pair using puttygen. Upload public key to your server in cloud or remote location. Description (how to do it. Generate a key/pair or use existing private key. If you have a private key. open puttygen, press load button and select your private key file. If you do not have a private key. Open puttygen. Select the desired key type SSH2 DSA (you may use RSA or DSA) within the Parameters section. and it is important that you leave the passphrase field blank. Press generate and follow instructions to generate (public/private) key pair. Create a new 'authorized_keys' file (with notepad. Copy your public key data from the "Public key for pasting into OpenSSH authorized_keys file" section of the PuTTY Key Generator, and paste the key data to the "authorized_keys" file. Make sure there is only one line of text in this file. Upload key to linux server. Open WinSCP. Select SFTP file protocol and login with your ssh credentials. On success, you see home directory structure at your remote machine. Upload authorized_keys file to home directory at remote machine. Set proper permissions. Make directory (if not existed. Copy authorized_keys file to directory. (this will replace any existed authorized_keys file, take note of this. If file existed, simply add contents of this file to the existing file. Run commands to set permissions. Now You will be able to ssh into remote machine without entering credentials everytime. Further reading.
PREVIOUS NEXT