Command Line Operation Over SSH
The OT-2 gives you command-line access to its operating system through a Secure Shell (SSH) terminal connection. Terminal access lets you:
- Run protocols directly via the Python API and command line.
- Perform advanced tasks like customizing the robot's Python environment.
- Execute protocols that reference external files on disk (apart from custom labware definition files).
An SSH key is required to perform these tasks and to issue commands from the terminal. The instructions below will show you how to create a key and connect to an OT-2 through a terminal window.
Before you begin¶
The OT-2 requires an Ethernet connection to generate an IP address and to register a security key. This means you cannot use a wireless connection for SSH. Instead, you must connect your computer to the robot with an Ethernet cable before working through the steps in this procedure.

If you're using a computer without an Ethernet port, make this connection using the dongle that shipped with your OT-2 or another adapter with an Ethernet port.
Create an SSH key¶
Follow these steps to create an SSH key on your Mac, Windows, or Linux computer:
-
Open a terminal window and run the following command:
-
Create a passphrase when prompted. A passphrase is not required, but it is recommended for extra security.
Get the robot's IP address¶
-
From the Opentrons App, click Devices and locate the robot that you want to work with.
-
Click the three-dot menu (⋮) for that robot and then click Robot settings.
-
Click the Networking tab. Copy the Wired IP address for your OT-2. The IP address is required to install the key.
Install and verify the key¶
-
Type the command shown below in the terminal window. Replace
ROBOT_IPwith the IP address of your OT-2.curl \ -H "Content-Type: application/json" \ -d "{\"key\":\"$(cat ot2_ssh_key.pub)\"}" \ http://ROBOT_IP:31950/server/ssh_keys ```
When successful, the robot responds with a message that the key has been added.
-
Type the command shown below in the terminal window to establish the connection. Replace
ROBOT_IPwith the IP address of your OT-2.Note
The first time you connect, the terminal will:
- Show a message indicating the authenticity of the host can't be established. Ignore the message.
- Ask if you want to continue. Type the full word
yesand press Enter or Return to continue.
-
Verify the connection. The terminal will show ASCII art that spells "OT2" when the connection is successful.
You can now interact with the OT-2 via the terminal.