SSH Guru Blog.
← SSH Guru Blog
Browser SSH
·6 min read

Keep SSH Keys Private and Local to Your Browser

ssh keysbrowser sshssh securitywebassembly
Laptop, apple, computer, desk
Photo: Pexels on Pixabay

Your SSH private key should stay on the device where you use it. A browser-based SSH client can do that when its SSH code and key handling run locally, rather than on a remote terminal server.

That matters when you connect to a home server from a Chromebook, check a Raspberry Pi from an iPad, or use a locked-down work laptop. Browser access is convenient. It should not require copying a private key into somebody else's infrastructure.

At SSH Guru, the SSH client runs in the browser. It is Go compiled to WebAssembly, a format browsers execute locally. The browser makes the SSH connection and uses the credential. Our service does not hold private keys, passwords, or SSH sessions.

This boundary reduces specific risks. It does not make the laptop, browser profile, or passphrase irrelevant.

A private key is a long-lived credential

An SSH private key proves that a client can log in as a particular account. It usually lasts longer than a browser session cookie and often grants access to systems with no second factor after the connection starts.

A private key needs different treatment from an ordinary application setting. If a hosted terminal platform stores your key, that platform becomes somewhere an attacker may try to obtain it. So do its backups, support tooling, account-recovery paths, and systems that can decrypt customer secrets.

The question is simple: where can this key exist in readable form?

With a conventional local SSH client, the answer is your computer, often in ~/.ssh/. With a browser client, it depends on the design. Some web terminals run the session on a provider-controlled machine. The provider's infrastructure must then use the key to open the SSH connection.

SSH Guru takes a different route. The client executes in your browser, which opens the SSH session. We designed the vault so keys and passwords are encrypted in the browser with a key derived from your passphrase using Argon2id, then encrypted with AES-256-GCM. Your passphrase is not something we can recover.

A local vault is not magic. It narrows the exposure path. The service cannot hand over a database of usable SSH keys because it does not have one.

What local key handling protects

Keeping credentials local changes the impact of a service-side problem.

If an attacker accessed a SaaS database containing account records, they would not find your decrypted SSH private key or an active SSH session held by SSH Guru. If somebody guessed or stole your SSH Guru account password, that alone would not give them the passphrase that unlocks an encrypted vault on your device.

It also avoids uploading the key for your NAS, Proxmox host, or Linux VPS to a third party just to get a terminal in a tab.

This helps where installing an SSH client is inconvenient. A Chromebook may be organisation-managed. An iPad can handle plenty of administration work, but file handling and key imports differ from a Linux laptop. A borrowed or locked-down machine may not allow package installs. A browser client is practical in each case while keeping the connection and credential use on the local device.

Local execution is only part of the picture. SSH server identity still needs checking.

When you first connect, SSH records the host key. Later, a changed key may mean a legitimate rebuild or key rotation. It may also mean you have reached the wrong machine or somebody is trying to intercept the connection. SSH Guru pins host keys in the browser and warns when one changes. Stop and verify the change through a separate channel.

Do not click past it because you need to restart a service.

For more on browser-client boundaries, read What Makes a Browser SSH Client Safe to Use.

What it does not protect

Local storage does not protect an already compromised device. Malware with access to your browser session may capture what you type, read what is displayed, or interfere after you unlock the vault. A browser extension with broad permissions can also be a problem.

The same applies to an unattended, unlocked laptop. If someone can sit down while its vault is open, local-only key storage will not save you.

Treat the device as part of your SSH security boundary:

  • Use full-disk encryption and a real screen lock.
  • Keep the browser and operating system patched.
  • Review extensions, especially those that can read and change data on every website.
  • Use a unique vault passphrase that is long enough that it cannot be guessed from personal information.
  • Lock the device when you step away, even during an active maintenance window.

A private key in a browser vault is still a private key. If it has broad access to many servers, compromise of the unlocked device has broad consequences. Separate keys by environment where that fits. A test VM key does not need access to the machine holding family photos or the host running production services.

On the server, restrict what each key can do where possible. Use separate Linux accounts. Avoid passwordless sudo for an account that only inspects logs. Remove old public keys promptly when a device is retired or lost.

Local does not mean manually copying files around

“Keep keys local” does not mean emailing yourself a PEM file, moving it through cloud storage, or repeatedly importing it from a USB stick. Those practices spread a credential.

Generate a key on the device that will use it, or deliberately import an existing key into its encrypted local vault. Install only the public half in ~/.ssh/authorized_keys on the server. The public key is meant to be distributed. The private half is not.

If you need access from more than one device, decide whether each needs the same identity. Often, create a distinct key per device and label it on the server. Revoking a lost tablet then means removing one public key rather than replacing a shared key everywhere.

Six months later, this helps when you find an unfamiliar key comment in authorized_keys and need to identify the old laptop it belonged to.

Browser SSH also avoids a common Chromebook and iPad workaround: sending a private key to a temporary web terminal, then hoping it is deleted correctly. The browser interface should be convenient, not an expanded list of places where your key has been copied.

Be careful with remote routes too

Keeping a key local answers the credential question. It does not decide how traffic reaches a server behind a home router, Starlink connection, mobile hotspot, or CGNAT.

For hosts that cannot accept inbound SSH connections, SSH Guru's ESP32-S3 Bridge is designed to dial outward. It can provide a route to permitted local SSH targets without port forwarding, inbound listeners, or router configuration. The bridge has allow-list rules written to the board, and changing them requires USB access.

That does not give a bridge access to an entire LAN. It is a route for the specific permitted SSH targets you configure. Your browser still uses the local credential to authenticate to the target server.

We cover that routing model in How SSH Works Without Port Forwarding.

A sensible browser SSH routine

Before connecting, check the address or saved host entry. Unlock the vault only on a device you trust. Check host-key change warnings rather than dismissing them. When finished, close the session and lock the device.

Those are ordinary operational habits. They matter more than a complicated setup you will bypass when you need to fix a service from an iPad at night.

A browser terminal should remove friction from reaching your own systems. It should not require giving up custody of the credential that opens them.

Comments

No comments yet. Be the first.

Leave a comment

Comments appear once the author approves them.