Rent a GPU

Guide · SSH and network hygiene

How do you secure a rented GPU instance?

Last updated: · 6 min read

Quick answer

How do you secure a rented GPU?

Log in with an ed25519 key only, turn off SSH passwords, keep model servers on 127.0.0.1 and reach them through an SSH tunnel. On RentGPUCrypto you paste the public key at launch, from $0.37 per GPU-hour paid in Monero or other crypto; the private key never leaves your laptop.

In brief
  • Keys: one ed25519 key pair per project; RentGPUCrypto only ever sees the public half.
  • SSH: no password logins, root by key only.
  • Services: vLLM, Jupyter and ComfyUI listen on 127.0.0.1; you reach them with ssh -L.
  • Secrets: Hugging Face and API tokens in environment variables or a token file, revoked when the job ends.
  • Account: add a password and two-factor authentication to the 16-digit account number.

Which risks matter on a rented GPU?

Common risks on a rented GPU instance and the fix for each
RiskWhat happensFix
Password SSHBots guess weak passwords around the clockPasswordAuthentication no, key-only root
Open inference portAnyone can use the model and your GPU-hoursBind to 127.0.0.1, use an SSH tunnel, add --api-key
Open Jupyter or ComfyUIA browser UI that can run code on the machineListen on 127.0.0.1 only, tunnel the port
Token in a scriptThe token leaks with the repo or the shell historyEnvironment variable or hf auth login, revoke after use
Leaked account numberSomeone can spend your balanceAccount password plus two-factor code
Leftover dataCheckpoints stay on a disk you no longer watchCopy out, then Delete: the disk is wiped

What are the steps, in order?

  1. Make a key for this project

    On your laptop run ssh-keygen -t ed25519 -C gpu-project, set a passphrase, and paste the .pub file content in the SSH public key field when you launch.

  2. Connect with the command shown

    Copy the SSH command from the instance page once it appears; it includes the host, port and user.

  3. Turn off password logins

    Set PasswordAuthentication no and PermitRootLogin prohibit-password in /etc/ssh/sshd_config, then restart the SSH service.

  4. Close the other ports

    Allow the port sshd listens on, deny other incoming traffic with ufw, and check you can still log in from a second terminal.

  5. Keep servers on localhost

    Start vLLM, Jupyter or ComfyUI on 127.0.0.1 and open them through an SSH tunnel.

  6. Load secrets from the environment

    Export HF_TOKEN in the session or log in with hf auth login; never commit tokens.

  7. Clean up

    Copy results out, revoke tokens you created for the job, then Delete the instance to wipe its disk.

Why only an SSH key, and which type?

An ed25519 key cannot be guessed the way a password can, and the server never learns the secret half. The launch form accepts keys that start with ssh-ed25519, ssh-rsa or ecdsa-sha2; ed25519 is short, fast and the default in current OpenSSH.

Use a separate key per project or per machine you rent, with a passphrase, and load it into ssh-agent so you type the passphrase once. If the private key is lost, it cannot be recovered from the instance: delete the instance and launch a new one with a new key. The SSH keys help page covers Windows and macOS.

How do you harden sshd without locking yourself out?

Change the config, test from a second terminal, and only then close the first session. The SSH command on the instance page may point at a forwarded port, while sshd inside the machine listens on its own port. Check that port first with ss -tlnp, and allow it in ufw before you enable the firewall.

# inside the instance, as root
sed -i 's/^#\?PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config
sed -i 's/^#\?PermitRootLogin .*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config
sshd -t && systemctl restart ssh

# find the port sshd listens on, then allow only that (apt install ufw if it is missing)
ss -tlnp | grep sshd
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp      # replace 22 with the port shown by ss
ufw enable
ufw status verbose

How do you reach vLLM, Jupyter or ComfyUI safely?

Bind each server to 127.0.0.1 and forward the port over SSH. An inference server on 0.0.0.0 with no key answers anyone who finds it, and every request is billed to your GPU-hours. A Jupyter or ComfyUI page on a public port is worse: both can run code on the machine.

Start the services locally on the instance, then open a tunnel from your laptop. vLLM also takes --api-key, so even through the tunnel each call needs a bearer token. ComfyUI listens on 127.0.0.1:8188 unless you pass --listen.

# on the instance
export VLLM_API_KEY="$(openssl rand -hex 24)"
vllm serve Qwen/Qwen3-14B --host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"
jupyter lab --ip 127.0.0.1 --port 8888 --no-browser

# on your laptop: forward both ports, then open http://localhost:8000 and :8888
ssh -p <port> -N -L 8000:127.0.0.1:8000 -L 8888:127.0.0.1:8888 root@<host>

Where should tokens and model credentials live?

In environment variables or the Hugging Face token file, never inside a script you copy around. For gated models such as Llama, hf auth login stores the token under ~/.cache/huggingface on the instance; export HF_TOKEN=... in the session works too. Create a read-only, fine-grained token for the rented machine and revoke it on the Hugging Face site when the job is done.

Shell history also keeps secrets: start a command with a space when HISTCONTROL=ignorespace is set, or read the value with read -s. Deleting the instance wipes the disk, and with it any token file left behind; move your results out first.

How do you protect the RentGPUCrypto account itself?

Treat the 16-digit account number like a password, then add a real password and two-factor authentication. Anyone with the number alone can log in to an account that has no password, spend its balance and launch instances. In the account settings you can add a password and an authenticator app; ten one-time recovery codes cover a lost phone.

Remember one rule: RentGPUCrypto staff never ask for your 16-digit account number, a wallet seed phrase or a private SSH key. Anyone who asks for one of these is not RentGPUCrypto. RentGPUCrypto's own data rule is short as well. For billing, RentGPUCrypto keeps each instance’s GPU model, host country, start and stop times for 30 days. RentGPUCrypto does not read the files on your disk. Details are on the privacy page.

Securing a GPU instance: common questions

Does RentGPUCrypto keep a copy of my private key?

No. You paste only the public key at launch, and the private key stays on your computer. If you lose it, delete the instance and launch a new one with a new key pair; the old disk cannot be reached without the key.

Can I expose my vLLM endpoint to the internet?

You can, but put an API key on it with --api-key, open only that port in the firewall, and prefer a reverse proxy with TLS in front. An open endpoint spends your GPU-hours for anyone who finds it, and you remain responsible for what it is used for.

Will ufw lock me out of the instance?

It can if you deny the port sshd listens on. Run ss -tlnp | grep sshd first, allow that port, enable ufw, and keep your first SSH session open until a second login works.

Does RentGPUCrypto read the files on my disk?

No. RentGPUCrypto does not read the files on your instance disk. For billing it keeps the GPU model, host country, start and stop times of each instance for 30 days.

Is my data gone after I delete an instance?

Yes. Delete wipes the instance disk for good, and it cannot be undone. Stop keeps the disk and stops the charge, so copy your checkpoints out before you delete.

Verdict
  • Key only: ed25519 with a passphrase, password logins off.
  • Nothing public by default: model servers and notebooks on 127.0.0.1, reached by SSH tunnel.
  • Clean exit: revoke tokens, copy results, then Delete to wipe the disk.
Sources (5)
  1. sshd_config(5) manual page — OpenBSD / OpenSSH
  2. ssh(1) manual page: -L local forwarding — OpenBSD / OpenSSH
  3. UFW: Uncomplicated Firewall — Ubuntu
  4. vLLM OpenAI-compatible server (--api-key) — vLLM
  5. Hugging Face CLI: hf auth login — Hugging Face

Start a key-only GPU instance

$3.70 for 10 RTX 4090 hours, paid in crypto. Paste your public key at launch.

RTX 4090 from $0.37/hr · no KYC

Rent a GPU