Generate SSH Key using PuTTY Key Generator
OpenSSH keys are used to log in to a Linux host without a password query prompt, or to run in batch processes, for example to enable authentication from scripts.
Generate OpenSSH Key
The PuTTY Key Generator generates a key par, after which the public key is copied to the remote host.
In the key comment field, your own email address can be entered, the generated private key is stored as privkey.ppk, the public key is stored as pubkey.ppk. The public key is stored on the remote host under the user’s home path in the .ssh directory in the authorized_keys file, and nothing can be changed in the copy & paste of the content.
[user@smarthost .ssh]$ ll Total 16 drwx------ 2 user user 4096 21 Oct 2013 . drwx------ 10 user user 4096 10 Apr 15:13 .. -rw------- 1 user user 1124 21 Oct 2013 authorized_keys
The directory .ssh should have the right 700 and the owner must be user. The user user should serve as an example here.
PuTTY with OpenSSH Key
The host should be logged in to this one, with the IP or host name in the Session and Host Name (or IP address) section.
The path to the private key generated with PuTTY Key Generator is entered under Connection – SSH – Auth.
Auto-login username defines the user who should authenticate.
With SSH daemon, key authentication is enabled in the configuration file /etc/ssh/sshd_config
# Authentication for user id's AllowUsers user # Allow key authentication RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys
Tip! PuTTY can be run in command-line, so scripts can be performed.
# use putty load session name "C:\Program Files\PuTTY\putty.exe" -load smarthost.mydomain.com # Use putty session command-line "C:\Program Files\PuTTY\putty.exe" -i C:\Users\user\ssh-privkey.ppk email@example.com
plink give the possibility to use PuTTY via CLI.
plink -i C:\Users\user\ssh\privkey.ppk firstname.lastname@example.org
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?