---
title: SSH Setup
description: Configure passwordless SSH for multi-node inference on DGX Spark.
---

All multi-node orchestration in sparkrun relies on SSH. At minimum, you need **passwordless SSH from your control machine to every cluster node**.

sparkrun pulls container images and models locally and pushes them to each node directly, so node-to-node SSH is not strictly required for the default workflow. However, setting up a **full SSH mesh** (every host can reach every other host) is recommended.

## Automatic setup with sparkrun

The easiest approach is `sparkrun setup ssh`, which creates a full mesh across your cluster hosts **and** the control machine (included automatically):

```bash
# Set up SSH mesh across your cluster + this machine
sparkrun setup ssh --hosts 192.168.11.13,192.168.11.14 --user ubuntu

# Or use a saved cluster
sparkrun setup ssh --cluster mylab

# Or use your default cluster
sparkrun setup ssh

# Add extra hosts beyond the cluster
sparkrun setup ssh --cluster mylab --extra-hosts 10.0.0.99

# Exclude the control machine from the mesh
sparkrun setup ssh --cluster mylab --no-include-self
```

You will be prompted for passwords on first connection to each host. After that, every host in the mesh can SSH to every other host without passwords.

## Manual SSH setup

If you prefer to set up SSH yourself:

```bash
# Generate a key if you don't have one
ssh-keygen -t ed25519

# Copy to each node
ssh-copy-id 192.168.11.13
ssh-copy-id 192.168.11.14
```

## SSH user configuration

By default, sparkrun uses your current OS user for SSH. You can configure the user per-cluster:

```bash
# Set during cluster creation
sparkrun cluster create mylab --hosts 192.168.11.13,192.168.11.14 --user dgxuser

# Update an existing cluster
sparkrun cluster update mylab --user dgxuser
```

Or override per-command with `--user`.

## Advanced SSH configuration

For non-default ports, identity files, or jump hosts, use `~/.ssh/config`:

```
Host spark1
    HostName 192.168.11.13
    User dgxuser

Host spark2
    HostName 192.168.11.14
    User dgxuser
```

## Docker group

The SSH user must be a member of the `docker` group on every cluster node:

```bash
sudo usermod -aG docker "$USER"
```

:::tip
Solo mode (`--solo`) runs on a single host and still uses SSH unless the target is `localhost`.
:::
