---
name: forgehand-connect
description: Connect to Forgehand sessions over SSH or JupyterLab and expose or remove session ports.
---

# Forgehand connections and ports

Connect only after the session reports **running**. An SSH public key must be on the account for SSH; JupyterLab opens through the browser. Session IP addresses can change on a new start.

## SSH and JupyterLab

- Web: on the workspace's session row, copy the complete `ssh root@...` command (it may include a port) or press **Open JupyterLab**.
- CLI: `fh session ssh <session-id>` waits for a running machine and starts the local SSH client. Extra SSH arguments go after `--`, for example `fh session ssh <id> -- -L 6006:localhost:6006`. `fh session jupyter <session-id>` prints a one-time JupyterLab URL; open it in a browser. Use a session ID, not a workspace name, for these commands.
- For VS Code Remote SSH or another SSH client, use the address shown on the session row and open `/workspace`. The user is `root`; password login is disabled. If SSH fails, check the session state, the account's public key in Settings, and the offered key with `ssh -v`.
- Keys added while a session is running are pushed to it within about a minute. If the network blocks SSH, use the terminal in JupyterLab as a fallback.

## Ports

Start the service inside the session bound to `0.0.0.0` on a port from 1024 to 65535, except reserved port 8888. In the web session row, enter the port, choose **team** or **public**, then press **Expose**. CLI equivalents are `fh port expose <session-id> <port>` for team access and `fh port expose <session-id> <port> --public` for an unauthenticated link. The returned HTTPS URL lasts only while the session exists. Choose public only when the user intends anyone with the link to reach the service.

To change visibility, expose the same port again with the desired visibility. Remove an exposure with the row's remove control or `fh port rm <session-id> <port>`.
