Using ~/.ssh/config
Give your machine a short name in your SSH config, with its host, port and user, so ssh, scp, rsync and VS Code work without long commands.
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 gpu replaces ssh -p 2211 renter@ssh.gputorent.com, and the same name works with scp, rsync and 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:
touch ~/.ssh/config
chmod 600 ~/.ssh/configAdd your machine
Take the port from the SSH command on your reservation page. For ssh -p 2211 renter@ssh.gputorent.com, add:
Host gpu
HostName ssh.gputorent.com
Port 2211
User renter
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
ServerAliveInterval 30Hostis the short name you'll type.HostNameis the same for every machine:ssh.gputorent.com.Portis your machine's own SSH port. It's never 22.Useris alwaysrenter.IdentityFileis your private key: the file without.pub.IdentitiesOnly yesmakes SSH offer only that key, which avoids "Too many authentication failures" when your agent holds many keys.ServerAliveInterval 30keeps an idle connection from being dropped by routers along the way.
Now connect with:
ssh gpuAnd copy files with the same name, no port flags needed:
scp ./data.zip gpu:~/
rsync -avP ./data/ gpu:~/data/Two machines at once
Give each reservation its own name and port. For example, a Mac Studio and a DGX Spark:
Host gpu
HostName ssh.gputorent.com
Port 2211
User renter
IdentityFile ~/.ssh/id_ed25519
Host spark
HostName ssh.gputorent.com
Port 2201
User renter
IdentityFile ~/.ssh/id_ed25519Port forwarding in the config
To forward a port every time you connect, for example Jupyter on port 8888 and a model server on port 8080:
Host gpu
HostName ssh.gputorent.com
Port 2211
User renter
IdentityFile ~/.ssh/id_ed25519
LocalForward 8888 localhost:8888
LocalForward 8080 localhost:8080While ssh gpu is connected, http://localhost:8888 and http://localhost:8080 reach those ports on the machine. See VS Code and Jupyter.
Host keys
SSH stores one host key per [ssh.gputorent.com]:port, so each machine has its own entry in ~/.ssh/known_hosts, whichever Host name you use. A machine keeps its host key from one rental to the next. If SSH ever warns that the host key changed, see Troubleshooting.
After your reservation
Your next reservation may be on another machine with a different port. Check the port on the new reservation page and update Port in your entry; the rest stays the same.