In order to use your public key you must transfer the public-key file (typically Identity.pub) created by the Key Generation wizard to the ~/.ssh directory on the SSH2 The second version of the SSH protocol which provides a way to encrypt network traffic between a client and a server, with a slightly different set of security features than the SSH1 protocol provides. server A computer program that provides services to other computer programs (called clients). Often the computer on which a server program runs is also called a server. The term host is often used as a synonym for server. . It is recommended that you follow the procedure below for using copy and paste to create a copy of the Identity.pub file in the ~/.ssh directory on the remote machine. If you decide instead to transfer the Identity.pub file to the ~/.ssh directory using an FTP client A computer or application that uses services provided by a server. , be sure to transfer the file in ASCII mode. Also be sure to complete step 4d below.
To use copy and paste to configure the SSH2 server to recognize your public-key file:
1. Log on to the remote SSH2 server using SSH2 and password authentication The process of verifying that an individual truly is who he or she claims to be. Supplying a password is a very common method of authentication. The most secure method of authentication supported in SecureCRT is public-key authentication. See also: identity file, public-private key pair. .
2. On the local machine, use Notepad.exe to open the Identity.pub file that was created with the Key Generation wizard.
3. With the Identity.pub file opened in the Notepad application, open the Edit menu and choose Select All. Once everything is selected, open the Edit menu again and select Copy.
4. On the remote machine, complete the following steps:
a. % cat > ~/.ssh/identity.pub
b. Click on the SecureCRT paste button to paste the contents of the Clipboard (which should now contain the contents of your Identity.pub file).
c. Issue a CTRL+D to close the Identity.pub file.
d. Convert the key to one that OpenSSH will recognize using the following command:
% ssh-keygen -i -f ~/.ssh/identity.pub >> ~/.ssh/authorized_keys
If you are connecting to a version of OpenSSH that is older than 2.9, use the following command instead:
% ssh-keygen -X -f ~/.ssh/identity.pub >> ~/.ssh/authorized_keys2
Note: If the key is an OpenSSH-format key, such as a converted key or a key exported from a certificate, the key does not need to be converted as shown above. Instead, use the following command:
% cat ~/.ssh/identity.pub >> ~/.ssh/authorized_keys
If you are connecting to a version of OpenSSH that is older than 2.9, use the following command:
% cat ~/.ssh/identity.pub >> ~/.ssh/authorized_keys2
e. Ensure that you are the only user with permissions to write to your "authorized_keys" file. This can be done using the following command:
% chmod 600 ~/.ssh/authorized_keys
The method described above uses only a single public key in the authorization file. It is possible to have more than one public key in the "authorized_keys" file. To add additional public keys, repeat steps 2 through 4.
Return to Public-Key Authentication for SSH2