How-to: Public Key Based Authentication Using OpenSSH
IBM's SDK for Multicore Acceleration IDE establishes connections to remote cell environments using Secure Shell (SSH).
Two SSH authentication methods are supported: password based and public key based. This document explains how to configure your client and server (as well
as how to configure the PTP Cell/B.E's environments) to use the public key authentication method.
Verify Software
First, confirm that OpenSSH is the SSH software installed on the client system. Public key generation may me different under different implementations
of SSH. The ssh -V command will print the version of your SSH software:
> $ ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
Key Generation
A RSA public/private key pair must be generated on the client system. The public key will be copied to the remote server that is
being connected to, while the private key will remain on the client machine in a secure location. The key pair generation is done using the ssh-keygen command:
client$ mkdir ~/.ssh
client$ chmod 700 ~/.ssh
client$ ssh-keygen -q -f ~/.ssh/id_rsa -t rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Key Distribution
Next, the public key ~/.ssh/id_rsa.pub needs to be copied to the remote server. Once the public key has been copied, you will
then append the key's contents to the file ~/.ssh/authorized_keys:
client$ scp ~/.ssh/id_rsa.pub user@server.example.com:
client$ ssh user@server.example.com
server$ mkdir ~/.ssh
server$ chmod 700 ~/.ssh
server$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ rm ~/id_rsa.pub
Confirm Functionality
Confirm that the public key authentication method is working by attempting to connect to the server. If the public key authentication method is being used,
then you will be asked for the passphrase when you connect:
client$ ssh -o PreferredAuthentications=publickey user@server.example.edu
Enter passphrase for key '/home/user/.ssh/id_rsa':
Cell Environment Configuration
Finally, the Cell Environment inside the PTP Cell/B.E needs to be configured. Note that public key authentication can be used on any of the Cell target environment types
except for the Local Cell Simulator type. The following steps explain how to configure your Cell Environment:
- In Eclipse, open the Cell Environments view
- Open the cell environment's configuration window by either creating a new environment (right click on environment type and select Create)
or by editing an existing environment (right click on existing environment and select Edit)
- Select the option Public key based authentication
- Press the Browse button next to the field File with private key, and select the private key file ~/.ssh/id_rsa
- Enter the passphrase that you entered when you created the public/private key pair
- Click Finish and start the environment using the green start arrow