Use SSH

The basic terminal SSH access provided by SubModel is not a full SSH connection and therefore does not support commands like SCP. To enable full SSH capabilities, you need to rent an instance with public IP support and run a full SSH daemon in your Pod.

Setup

  1. Generate SSH Key Pair: On your local machine, generate a public/private SSH key pair using the command:

    ssh-keygen -t ed25519 -C "your_email@example.com"

    This will save your public key to ~/.ssh/id_ed25519.pub and your private key to ~/.ssh/id_ed25519.

    Note: If you're using Command Prompt in Windows (not WSL or Linux terminal), your keys will be saved to:

    C:\users\{yourUserAccount}\.ssh\id_ed25519.pub
    C:\users\{yourUserAccount}\.ssh\id_ed25519
    SSH Key Generation
  2. Add Public Key to SubModel: Log in to your SubModel user settings and add your public key.

    SubModel User Settings
    Public Key Addition
  3. Start Your Pod: Ensure the following:

    • Your Pod supports a public IP (if deploying in Community Cloud).

    • An SSH daemon is running. If using a SubModel official template (e.g., SubModel Stable Diffusion), no additional steps are needed. For custom templates, ensure TCP port 22 is exposed and use the following Docker command. Replace sleep infinity with your existing command if applicable:

      bash -c 'apt update; DEBIAN_FRONTEND=noninteractive apt-get install openssh-server -y; mkdir -p ~/.ssh; cd $_; chmod 700 ~/.ssh; echo "$PUBLIC_KEY" >> authorized_keys; chmod 700 authorized_keys; service ssh start; sleep infinity'
    Pod Initialization

Once your Pod initializes, you can SSH into it using the SSH over exposed TCP command from the Pod's Connection Options menu.

Note:

  • If using Windows Command Prompt (not WSL or Linux terminal) and you used the default key location, modify the file path in the SSH command after the -i flag to:

    C:\users\{yourUserAccount}\.ssh\id_ed25519
  • If you saved your key to a non-default location, specify that path after the -i flag.

SSH Connection
SSH Connection Options

What's the SSH Password?

If prompted for a password during connection, something is wrong. SubModel does not require a password for SSH connections. Common issues include:

  • Copying the key fingerprint (starting with SHA256:) instead of the public key (contents of id_ed25519.pub).

  • Omitting the encryption type (ssh-ed25519) when copying the public key.

  • Not separating multiple public keys with a newline in SubModel user settings.

  • Specifying an incorrect file path to your private key:

    Incorrect File Path
  • Using a private key with incorrect permissions:

    Permissions Issue
  • Incorrect private key specified in the SSH config file. Ensure the IdentityFile in your ~/.ssh/config points to the correct private key. A mismatch will prompt for a password.

    Private Key Fix

Last updated