Appendix

Generating and Using SSH keys

SSH keys allow SSH connections to be made without the need for a password. SSH keys operate in pairs: a private key kept on the host (local) machine, and a public key copied to the authorized_keys file on the FPGA board.

To generate and use an SSH key with NengoFPGA, follow the instructions below. To support both the Windows and Unix-based operating systems, NengoFPGA uses SSH keys using the OpenSSH format.

Windows

The best way to generate an SSH key in Windows is to use PuTTY.

  1. Download and install PuTTY.
  2. Under the PuTTY group in the windows start menu, run the PuTTYgen application.
  3. Click the Generate button, and follow the on-screen instructions to generate a random SSH key pair.

Exporting the SSH private key:

  1. Click the Conversions drop-down menu, and select Export OpenSSH key. Leave the Key passphrase blank.
  2. Choose a save location for the SSH key (e.g., the install location of nengo-fpga).

Exporting the SSH public key:

  1. Keep PuTTYgen open. Do not regenerate the SSH key pair.
  2. SSH into the FPGA board using a username and password combination. The username used will have the SSH keys generated with these steps associated with it.
  3. Edit the ~/.ssh/authorized_keys file with a text editor (e.g., nano, vi)
  4. Copy the public key text from the “Public key for pasting into OpenSSH authorized_keys file” area of PuTTYgen and paste it at the end of the authorized_keys file.

Linux and Mac

  1. Open a terminal. If SSH is not installed, install it with sudo apt-get install ssh.

  2. Enter the command: ssh-keygen -t rsa

  3. The command above will prompt for a location to save the SSH private key. Leaving this blank will save it to the default location of ~/.ssh/id_rsa.

  4. The ssh-keygen command will also prompt for a passphrase. Leave the passphrase empty (press Enter twice).

  5. Copy the SSH public key to the FPGA board with the command ssh-copy-id -i <location of private key> <ssh username>@<FPGA board IP>. For example:

    ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
    

Note

If the ssh-copy-id command does not work, or is unavailable, copy the contents of the *.pub file (this is the generated SSH public key) located in the same location as the SSH private key into the ~/.ssh/authorized_keys of the appropriate user on the FPGA board.

Configuring the fpga_config file

After generating the SSH key pair, test that they have been properly installed by SSH’ing into the FPGA board. If a connection is made without needing to provide a password, then the SSH key has been successfully installed.

If the SSH key has been successfully installed NengoFPGA can be configured to use the keys by replacing the ssh_pwd entry with ssh_key, and providing the location of the SSH private key on the host system. As an example, if the SSH private key is located in ~/.ssh/id_rsa on the host system, the ssh_key would be:

ssh_key = ~/.ssh/id_rsa

Note

The config file can have either ssh_pwd or ssh_key but not both.

Finding your IP Address

To find the IP address of your computer follow the instructions for your operating system below.

Note

Ignore any address like 127.0.0.1

Windows

  1. Press Win + r to open the “run” dialog box.
  2. Type in cmd and press Enter to open the windows command prompt.
  3. Type ipconfig, and look for the IPv4 Address entry of the desired network interface. This is your IP address.

Linux and Mac

  1. Open a terminal and type ifconfig | grep "inet "