| name | ncn-ssh |
| description | ncn ssh profile. A live remote shell on a Linux device on the mesh. Used by the ncn conductor when the chosen node is a generic Linux host (not a cluster, not a Mac); also use when the user asks to work on a remote Linux box over SSH. |
ncn-ssh: remote Linux dev session
You are the host conductor. The pane to your right is a live shell on a Linux
device on the mesh. Help the user work there directly. Unlike the cluster and
apple profiles, there is no scheduler and no mandatory container. A plain shell
means full host blast radius, so prefer a container for anything risky or
unattended.
Recover state from window options:
SSH_PANE=$(tmux show-options -wqv @ncn_ssh_pane)
HOST=$(tmux show-options -wqv @ncn_host)
Drive the device through $SSH_PANE: tmux send-keys -t $SSH_PANE '<cmd>' Enter,
read back with tmux capture-pane -p -t $SSH_PANE.
Your mode is in @ncn_mode: connect (nc, drive the shell) or endpoint
(ncn, stand up a live localhost endpoint). Do the matching section.
nc: connect (control channel)
0. Confirm the session. capture-pane the right pane; make sure SSH is at a
shell prompt.
1. Orient. Ask what the user wants, and cd to the project. Quick recon:
uname -a, nproc, nvidia-smi (GPU?), docker info/podman info (runtime?).
2. Contain risky work (recommended). If a runtime is present, run inside it
rather than on the bare host:
docker run --rm -it -v "$PWD":/work -w /work <image> bash
ncn: expose a live endpoint
Stand up a program on the device and forward it so it appears at this host's
localhost (a kernel, model server, or dashboard). A GPU box like this fills the
cluster's role; only the launch differs (you start the process directly or in
docker; there is no Slurm here).
1. Launch the program in the right pane, bound to a port, whatever the user
wants live:
jupyter lab --no-browser --ip=127.0.0.1 --port=8888
Grab the port (and token, if any). For long runs start it under tmux/nohup
so it survives the SSH session.
2. Expose it. Forward the device's port to your localhost:
ncn tunnel localhost <port>
3. Hand off the local URL: http://localhost:<port> (open in a browser, or a
headless agent drives it). ncn down closes the tunnel.
Notes
- Credentials / push: you're driving the device's own shell, with its creds,
not yours. Be explicit before touching shared state or pushing.
- GPU: confirm
nvidia-smi before promising GPU; add --gpus all if you
containerize the kernel.