|
OpenSSH. A Survival Guide for Secure Shell Handling, Version 1.0 Authors: Hudak T., Sibley B. Published year: 2002 Pages: 41-42/90 |
Now we need to tell PuTTY to use public key authentication to log into the server:
Double-click on the icon that was created for PuTTY or select it from the to start another instance of PuTTY.
In the Session category of the PuTTY configuration screen, enter the host name or IP address of the server that you've configured for public key authentication.
Make sure the SSH protocol is selected by clicking on the radio button next to SSH in the Protocol section.
In the left-hand window, select the Connection->SSH->Auth category. This is the category that controls some of the options for SSH authentication:
In the section marked Authentication parameters , click on the Browse button located below the field entitled Private key file for authentication: .
Click on the Browse button and a dialog box will appear allowing you to specify the private key file you created for your connection to the server. Once you have selected the private key file, click on the Open button and you will return to the PuTTY configuration screen. The name of the file in which the private key is stored should now be listed in the Private key file for authentication: field.
Click on the Open button. PuTTY will now attempt to contact the remote server and authenticate using public key authentication.
Next, PuTTY will ask for your user name. This is the user name of the account on the remote host.
If public key authentication has been configured correctly, you will be told that you are authenticating with your public key and you will be asked for the passphrase for your key.
login as: sshuser
Authenticating with public key sshuser@server.example.com
Passphrase for key "sshuser@server.example.com": ***************************
[sshuser@server.example.com]$
If the passphrase was not entered correctly, you will be given 2 more attempts to try again. After the 3rd attempt, the SSH connection will either abort, or, if the OpenSSH server has been configured to allow both public key AND password authentication, you will be prompted for the account password.
We have seen that we can use public key authentication with PuTTY, the graphical SSH interface, but sometimes we may want to use public key authentication when using the PuTTY command line tools PSCP, PSFTP and Plink.
Each of these programs provides a “i command line option for specifying the path and filename of the file containing the private key. Whenever the “i option is specified for any of these tools, they will automatically try to authenticate using public key authentication.
The following example shows how to use PSCP to transfer files using public key authentication. The same procedure is used for PSFTP and Plink:
Open a Windows command prompt by clicking on the Start Menu and selecting Run . In the Open prompt, type cmd if you are running Windows NT/2000/XP or command if you are running Windows 9x/ME and press the OK button.
At the Windows command prompt, use PSCP to copy a file using the -i option with the path and file name of the file containing the private key, as shown below:
C:\temp>pscp -i "c:\temp\mykeys\my_private.PPK" test.pl sshuser@server.example.com:.
Authenticating with public key sshuser@server.example.com
Passphrase for key "sshuser@server.example.com": *************************
test.pl 22 kB 22.0 kB/s ETA: 00:00:00 100%
C:\temp>
|
OpenSSH. A Survival Guide for Secure Shell Handling, Version 1.0 Authors: Hudak T., Sibley B. Published year: 2002 Pages: 41-42/90 |