Technical Notes |
|
This technical note describes the steps you must follow to use public key authentication when connecting from an F-Secure SSH Client for Windows to an OpenSSH server. You will use the Key Generation utility to generate a keypair and upload the public key to the server. Then you will use the command line to convert the public key to OpenSSH format. Troubleshooting tips are also included.
Public key authentication is one way a server can authenticate a user. It requires a private and public keypair; the private key is located on the client, and the public key must be uploaded to the SSH server.
When a keypair is created on an SSH client, each key of the keypairpublic and privateis written to a separate file in a particular format. The format for the public key is SecSH. The format for the F-Secure Windows Client private key is PKCS #7 for versions 5.4 or higher, or proprietary for versions 5.3 and earlier.
Use the F-Secure Key Generation utility to generate a keypair and upload the public key to the OpenSSH server.
Note: If you prefer not to use the Key Generation utility, you can use ssh-keygen2 from the command line to generate a keypair. To obtain a list of options, type ssh-keygen2 h on the command line.
The public key format supported by OpenSSH servers is OpenSSH. Now that you have uploaded the public key to the OpenSSH server, you must convert the public key format from SecSH (the format generated by the F-Secure SSH client) to OpenSSH (the format supported by OpenSSH servers). To do this, follow these steps:
ssh-keygen i -f publickeyname.pub >>authorized_keysNote: Use the >> symbol to append to the authorized_keys file. The > symbol will overwrite the file.
Command switches used:
| -i |
Convert IETF SecSH to OpenSSH key file |
| -f filename |
Filename of the key file |
rm authorizationIf you are having trouble connecting, check the issues listed below.
Verify that the file permissions on the server are configured properly. Setting the $HOME/.ssh directory to 744 and the authorized_keys file to 600 will allow key authentication to work. For more information on permissions, see technical note 1178 about "Understanding UNIX and NFS Permissions".
On the F-Secure SSH Client for Windows:
On the client's Edit menu, click Settings. In the Settings dialog box, on the left pane under Profile > Connection, select Authentication. Verify that Public Key is listed under Authentication Methods and that User Keys is listed under Public-Key Authentication Methods.
On the OpenSSH server:
The server configuration file, sshd_config, should include the following entries:
PubkeyAuthentication yesAuthorizedKeysFile .ssh/authorized_keysThe public key should be uploaded to the authorized_keys file in the .ssh directory on the OpenSSH server.
If you use the Key Generation utility to upload the public key, the utility allows only the public key to be uploaded. If, however, you manually transfer the key to the server, verify that you transferred the public key.