USB SSH Networking

Overview

This section outlines how to create a local tunnel between the module and a PC over USB allowing an SSH connection between the two. This requires that the PC connects both to the micro-USB connector for UART serial communication as well as the USB Type-C connector for SSH.

Instructions

The instructions below give the steps for setup with an Ubuntu Linux* PC. Similar functionality can be implemented with a Windows* or macOS* connection.

  1. Connect a micro-USB cable from the module to the PC for UART connection (if not already connected).
  2. From the PC terminal open a UART shell (e.g., “picocom -b 115200 /dev/ttyUSB0”).
  3. In the UART shell (or the module terminal directly) type “ifconfig” and note down the IP address ("inet addr") of the usb0 connection.
Note: This will likely have been pre-configured in the Ref-OS-IoT image to be "169.254.2.2" but should still be checked

 

  1. Now connect a USB Type-C cable from the module to the PC for SSH connection.
  2. The Ubuntu* PC will automatically recognize a new wired connection (e.g. "Wired connection 2")
  3. From the PC go to System Settings... > Network, choose the new Wired connection and choose the "Options..." button to edit it
  • On the Wired tab, click Add to create a new connection configuration. Give the connection a name. In the Device MAC address field, select the usb0 connection.

  • On the IPv4 Settings tab, set "Method" to be "Manual"

  • Under the "Addresses" field choose "Add" give it an IP address that is on the same sub network but not the same as the development board showed when running ifconfig. For the default module IP address of "169.254.2.2" change the last digit from 2 to 3.

  • Set the netmask to 255.255.255.0 and the Gateway to 0.0.0.0.

  • On the same tab, press the Routes button and tick the “Use this connection only for resources on its network”

  • Save the connection settings and close the Network Connections window

  1. Open a terminal on the PC and run “ifconfig”. You should now see an IP address for the usb0 connection
  2. On the module edit the file /etc/ssh/sshd_config and either add or uncomment the line “PermitRootLogin yes”
  3. The module cannot be accessed as root user from the host unless a password has been set. If one doesn’t already exist then set this from the client command-line using “passwd” to set a new one
  4. From the PC type “ssh root@169.254.2.2” and enter the password when requested to make an ssh connection to the development board

Testing

The connection should now be complete and allow a simple file transfer between host and client. An example would be:

scp file.txt root@169.254.2.2:.

 

For more complete information about compiler optimizations, see our Optimization Notice.