Skip to main content

Using ~/.ssh/config

Give your machine a short name in your SSH config, so ssh, scp and rsync work without long addresses.

On this page

Your SSH client reads a config file where you can give a host a short name and remember its options. With an entry for your reservation, ssh gtl replaces the full command, and the same name works with scp, rsync and editors such as VS Code's Remote-SSH.

Where the file is

  • macOS and Linux: ~/.ssh/config
  • Windows: C:\Users\<you>\.ssh\config (no file extension)

Create it if it doesn't exist. On macOS and Linux, keep it private:

bash
touch ~/.ssh/config
chmod 600 ~/.ssh/config

Add your machine

Take the user and address from the SSH command in your dashboard. For ssh user@my-llm-box.res-4ad0a522.ssh.gputolease.ai, add:

ssh-config
Host gtl
    HostName my-llm-box.res-4ad0a522.ssh.gputolease.ai
    User user
    IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes
    ServerAliveInterval 30
  • Host is the short name you'll type.
  • IdentityFile is your private key: the file without .pub.
  • IdentitiesOnly yes makes SSH offer only that key, which avoids "Too many authentication failures" when your agent holds many keys.
  • ServerAliveInterval 30 keeps an idle connection from being dropped by routers along the way.

Now connect with:

bash
ssh gtl

One entry for every reservation

Every reservation has its own address, but they all end in .ssh.gputolease.ai. A wildcard entry sets your key and options for all of them:

ssh-config
Host *.ssh.gputolease.ai
    IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes
    ServerAliveInterval 30

With it, the full command from your dashboard just works, and you can still add a short Host alias per reservation.

Port forwarding in the config

To forward a port every time you connect, for example a model server on port 8080:

ssh-config
Host gtl
    HostName my-llm-box.res-4ad0a522.ssh.gputolease.ai
    User user
    LocalForward 8080 localhost:8080

After your reservation

Each reservation is a freshly wiped machine at a new address, so update HostName for your next reservation. See Troubleshooting if SSH warns that a host key has changed.