Public Key Authentication is one of the methods to connect to an OpenSSH server. It requires the use of public and private key pairs, where the private key needs to be added to the server's authorized_keys file.
PuTTY allows you to log in to an SSH server using the public key authentication method. It only supports PuTTY Private Key (ppk) format for the private key, which, if you have an existing OpenSSH private key, needs to be converted to the ppk format.
Steps to connect to SSH server using public key in PuTTY:
- Create a public and private key pair if you don't already have one.
- Copy your public key to server's authorized_keys file.
- Launch PuTTY.
- Enter connection details such as Host Name / IP address and port.
- Navigate to Connection → SSH → Auth from the sidebar menu.
- Click on the Browse button to look for your PuTTY Private Key.
- Select your PuTTY Private Key from the stored location and click on the Open button.
- Click on the Open button to start the connection.
- Click Yes if a security alert pops up as this is your first connection to the server and the server's key fingerprint is not in your PuTTY's cache.
- Enter the username that you want to connect as and press enter.
- Enter the passphrase for the key if a passphrase protects your key.
- You should be able to log in without providing your password to the system.
Comment anonymously. Login not required.