Changes between Initial Version and Version 1 of User Guide/Portal/SSH


Ignore:
Timestamp:
Mar 30, 2026, 5:53:57 PM (6 hours ago)
Author:
editor
Comment:

New: SSH Access sub-page

Legend:

Unmodified
Added
Removed
Modified
  • User Guide/Portal/SSH

    v1 v1  
     1[[Include(WikiToC)]]
     2= SSH Access to Testbed Nodes =
     3
     4Once you have an approved reservation and your SSH public key uploaded to the portal, you can connect to testbed nodes using SSH. This page explains the testbed's SSH access model, connection patterns, tunneling techniques, and configuration tips.
     5
     6----
     7
     8== Access Model ==
     9
     10The COSMOS/ORBIT testbed uses a '''two-hop SSH access model''':
     11
     121. '''Console server (jump host)''' — you first SSH into the console server for the testbed domain you reserved. You authenticate with your '''portal username''' and your '''SSH key'''.
     132. '''Testbed node''' — from the console server, you hop to individual testbed nodes. On baseline images, you log in as '''root'''. The console server automatically has root SSH access to all nodes in its domain.
     14
     15This two-hop model exists because testbed nodes are on internal networks (10.x.x.x addresses) that are not directly reachable from the Internet. The console servers act as secure gateways.
     16
     17'''Important terminology:'''
     18* Your '''portal username''' (e.g., `jsmith`) is used on '''console servers'''
     19* The '''root''' account is used on '''testbed nodes''' when running baseline images
     20* If you load a custom image, the node's SSH configuration depends on how you configured that image
     21
     22----
     23
     24== Console Servers ==
     25
     26Each testbed domain has its own console server. The console server hostname follows the pattern `console.<domain>` or simply `<domain>`:
     27
     28||= Domain =||= Console Server =||= Location =||
     29|| grid.orbit-lab.org || console.grid.orbit-lab.org || ORBIT Main Grid (400 nodes) ||
     30|| sb1.orbit-lab.org || console.sb1.orbit-lab.org || ORBIT Sandbox 1 ||
     31|| sb2.orbit-lab.org || console.sb2.orbit-lab.org || ORBIT Sandbox 2 ||
     32|| sb3.orbit-lab.org || console.sb3.orbit-lab.org || ORBIT Sandbox 3 (USRP/GNURadio) ||
     33|| sb4.orbit-lab.org || console.sb4.orbit-lab.org || ORBIT Sandbox 4 (RF Matrix) ||
     34|| sb7.orbit-lab.org || console.sb7.orbit-lab.org || ORBIT Sandbox 7 ||
     35|| sb9.orbit-lab.org || console.sb9.orbit-lab.org || ORBIT Sandbox 9 (Wired/SDN) ||
     36|| outdoor.orbit-lab.org || console.outdoor.orbit-lab.org || ORBIT Outdoor Network ||
     37|| sb1.cosmos-lab.org || console.sb1.cosmos-lab.org || COSMOS Sandbox 1 ||
     38|| sb2.cosmos-lab.org || console.sb2.cosmos-lab.org || COSMOS Sandbox 2 (Columbia) ||
     39|| bed.cosmos-lab.org || console.bed.cosmos-lab.org || COSMOS BED (West Harlem, NYC) ||
     40|| weeks.cosmos-lab.org || console.weeks.cosmos-lab.org || COSMOS Weeks Hall (Industry 4.0) ||
     41
     42For a gateway connection (file transfer, tunneling) without a specific domain reservation, you can use:
     43* `gw.cosmos-lab.org` — COSMOS gateway
     44* `gw.orbit-lab.org` — ORBIT gateway
     45
     46----
     47
     48== Basic Connection ==
     49
     50The simplest way to connect to a testbed node is using SSH's `-J` flag (ProxyJump), which routes your connection through the console server in a single command:
     51
     52{{{
     53ssh -J <username>@<console> root@<node>
     54}}}
     55
     56For example, to connect to node1-1 in COSMOS Sandbox 1:
     57{{{
     58ssh -J jsmith@console.sb1.cosmos-lab.org root@node1-1
     59}}}
     60
     61Or to connect to node5-5 in the ORBIT Grid:
     62{{{
     63ssh -J jsmith@console.grid.orbit-lab.org root@node5-5
     64}}}
     65
     66The `-J` flag tells SSH to first connect to the console server (authenticating with your portal username and SSH key), then transparently hop to the target node as root. You do not need to manually log into the console and then SSH to the node — it all happens in one step.
     67
     68'''Shorthand:''' For many domains, you can use the domain name directly as the console (without the `console.` prefix):
     69{{{
     70ssh -J jsmith@sb1.cosmos-lab.org root@node1-1
     71}}}
     72
     73----
     74
     75== SSH Config File ==
     76
     77For frequent use, configuring your `~/.ssh/config` file avoids typing long SSH commands. Here is a recommended configuration:
     78
     79{{{
     80# COSMOS/ORBIT Gateway (for file transfer and general access)
     81Host cosmos-gw
     82    HostName gw.cosmos-lab.org
     83    User jsmith
     84
     85# COSMOS SB1 Console
     86Host cosmos-sb1
     87    HostName console.sb1.cosmos-lab.org
     88    User jsmith
     89
     90# Quick access to SB1 nodes (usage: ssh sb1-node1-1)
     91Host sb1-node*
     92    ProxyJump cosmos-sb1
     93    User root
     94
     95# ORBIT Grid Console
     96Host orbit-grid
     97    HostName console.grid.orbit-lab.org
     98    User jsmith
     99
     100# Quick access to Grid nodes (usage: ssh grid-node5-5)
     101Host grid-node*
     102    ProxyJump orbit-grid
     103    User root
     104
     105# General settings for all testbed hosts
     106Host cosmos-* orbit-* sb1-node* grid-node*
     107    StrictHostKeyChecking no
     108    UserKnownHostsFile /dev/null
     109    ServerAliveInterval 60
     110    ServerAliveCountMax 3
     111}}}
     112
     113With this configuration, connecting to a node is as simple as:
     114{{{
     115ssh sb1-node1-1
     116}}}
     117
     118The `StrictHostKeyChecking no` and `UserKnownHostsFile /dev/null` settings prevent SSH from complaining about changed host keys, which is expected behavior on testbed nodes that are frequently reimaged with different operating systems.
     119
     120The `ServerAliveInterval` and `ServerAliveCountMax` settings send keepalive packets to prevent idle connections from being dropped by firewalls.
     121
     122----
     123
     124== SSH Tunneling == #Tunneling
     125
     126SSH tunnels let you securely access network services running on testbed nodes (such as web interfaces, Jupyter notebooks, or custom dashboards) from your local machine. All traffic flows encrypted through the SSH connection.
     127
     128=== Local Port Forwarding ===
     129
     130Local port forwarding maps a port on a remote testbed node to a port on your local machine. This is the most common type of tunnel.
     131
     132'''Example: Access a Jupyter notebook running on port 8888 of node1-1:'''
     133{{{
     134ssh -L 8888:localhost:8888 -J jsmith@console.sb1.cosmos-lab.org root@node1-1
     135}}}
     136
     137After running this command, open `http://localhost:8888` in your web browser to access the Jupyter notebook. The traffic is encrypted and routed through the SSH connection.
     138
     139'''Example: Access a web dashboard on port 3000:'''
     140{{{
     141ssh -L 3000:localhost:3000 -J jsmith@console.sb1.cosmos-lab.org root@node1-1
     142}}}
     143
     144You can forward multiple ports simultaneously by adding additional `-L` flags:
     145{{{
     146ssh -L 8888:localhost:8888 -L 3000:localhost:3000 -J jsmith@console.sb1.cosmos-lab.org root@node1-1
     147}}}
     148
     149=== Dynamic SOCKS Proxy ===
     150
     151A dynamic SOCKS proxy creates a general-purpose encrypted tunnel that you can route any TCP traffic through:
     152{{{
     153ssh -D 1080 -J jsmith@console.sb1.cosmos-lab.org root@node1-1
     154}}}
     155
     156Then configure your web browser to use `localhost:1080` as a SOCKS5 proxy. All web traffic will be routed through the testbed node, letting you access internal testbed services and web interfaces as if you were on the testbed network.
     157
     158=== Remote Port Forwarding ===
     159
     160Remote port forwarding makes a service running on your local machine accessible from the testbed node. This is useful for sending data from the testbed to a service on your laptop:
     161{{{
     162ssh -R 5000:localhost:5000 -J jsmith@console.sb1.cosmos-lab.org root@node1-1
     163}}}
     164
     165After this, processes on node1-1 can connect to `localhost:5000` and reach the service running on port 5000 of your local machine.
     166
     167----
     168
     169== File Transfer ==
     170
     171To copy files between your local machine and testbed nodes, use `scp` or `rsync` with the ProxyJump option:
     172
     173'''Upload a file to a node:'''
     174{{{
     175scp -J jsmith@console.sb1.cosmos-lab.org localfile.txt root@node1-1:/root/
     176}}}
     177
     178'''Download a file from a node:'''
     179{{{
     180scp -J jsmith@console.sb1.cosmos-lab.org root@node1-1:/root/results.csv ./
     181}}}
     182
     183'''Sync a directory:'''
     184{{{
     185rsync -avz -e "ssh -J jsmith@console.sb1.cosmos-lab.org" root@node1-1:/root/data/ ./data/
     186}}}
     187
     188For large file transfers, consider using the gateway (`gw.cosmos-lab.org`) and the NFS-shared filesystem at `/mnt/datasets/` which is accessible from all console servers and nodes.
     189
     190----
     191
     192== Troubleshooting ==
     193
     194'''Connection refused or timeout'''
     195* Verify that you have an '''active''' (approved) reservation for the domain — pending reservations do not grant access
     196* Check that your SSH public key is uploaded in the portal (not the private key)
     197* Ensure you are using your '''portal username''' (not root) for the console server
     198
     199'''Permission denied (publickey)'''
     200* Make sure the public key on the portal matches the private key on your machine
     201* Try specifying the key explicitly: `ssh -i ~/.ssh/id_ed25519 -J jsmith@console.sb1.cosmos-lab.org root@node1-1`
     202* Check that your private key file has correct permissions: `chmod 600 ~/.ssh/id_ed25519`
     203
     204'''Host key verification failed'''
     205* Testbed nodes are frequently reimaged, changing their SSH host keys. Add these lines to your `~/.ssh/config` for testbed hosts: `StrictHostKeyChecking no` and `UserKnownHostsFile /dev/null`
     206
     207'''Connection drops after idle time'''
     208* Add `ServerAliveInterval 60` to your SSH config to send keepalive packets every 60 seconds
     209
     210=== Further Reading ===
     211
     212* [https://www.ssh.com/academy/ssh/tunneling SSH Academy: SSH Tunneling] — explanation of local, remote, and dynamic forwarding
     213* [https://man.openbsd.org/ssh OpenBSD: ssh manual page] — the authoritative reference for all SSH options
     214* [https://www.digitalocean.com/community/tutorials/how-to-configure-custom-connection-options-for-your-ssh-client DigitalOcean: SSH Config Tutorial] — guide to setting up `~/.ssh/config`