SSH to your robot

    Overview

    Robots are commonly deployed behind NAT devices. These devices restrict the methods that can be used to access the robot. Notably, you cannot dial directly into the robot since it does not have a static, global address and port. The primary goal of this feature is to provide a mechanism that allows you to connect via SSH directly to your robot running the Formant agent. 

    Assumption

    It is assumed that an SSH server is already running on the robot. SSH server software (openssh-server) is installed by default in most Linux distributions.

    Port forwarding enables the following: 

    • Secure file transfer using sftp

    • Secure copy using scp

    • Connect visual tools like rviz from your desktop directly to the remote robot

    • Forward any port from your robot to your local machine

    • Create on the fly VPN using SSH-VPN

    Prerequisite

    SSH requires the latest version of Formant's command-line interface (fctl) to be installed. Please read installing fctl for more information.

    Step 1: Verify ~/.ssh/config file

    fctl adds the following to the top of your ~/.ssh/config file. Verify that the following exists in your ~/.ssh/config file. If not, add it to the top of the file.

    Mac/Linux:

    Host *.formant
            ProxyCommand fctl port-forward $(echo %h | sed "s/\.formant$//") -r 127.0.0.1 -p %p

    Docker:

    Host *.formant
            ProxyCommand docker run -i -a stderr -a stdin -a stdout --rm -v <permanent_storage>:/root/.formant formant/fctl port-forward $(echo %h | sed "s/\.formant$//") -r 127.0.0.1 -p %p

    This attaches STDIN, STDOUT, and STDERR to the container which is necessary for SSH ProxyCommand, as well as removing the container with --rm when exiting.

    Does your robot name have spaces?

    This is a limitation of ~/.ssh/config.  SSH host names do not allow spaces.  To bypass this issue, just enter in the commands that SSH would normally template out for you:

    fctl port-forward “My Device Name” -r 127.0.0.1 -p 22 -l 127.0.0.1:9000
    ssh <user>@127.0.0.1:9000

    Step 2: SSH

    $ ssh <user>@<device_name>.formant

    Unable to SSH?

    Confirm with your administrator that SSH is enabled on this device. For more information refer to configuring SSH


    © 2020 Formant • 1999 Bryant St · San Francisco, CA 94110