How to make an SSH key on a Chromebook, with or without Linux
GitHub, a hosting company or a university server wants your public SSH key. On a Mac or a Linux machine that is one command. On a Chromebook it depends on whether you are allowed a terminal.
Written · Updated
If your Chromebook has the Linux development environment, open its Terminal and run ssh-keygen -t ed25519; that is the standard route and needs nothing else. If Linux is not available, which is common on school and work Chromebooks where the administrator has switched it off, you can make an OpenSSH key pair in the browser with SSHKEY, which uses the browser’s own cryptography and writes the same files ssh-keygen does, then import the private key into Google’s Secure Shell extension or give the public key to GitHub. The private key is made in the tab and stays on your Chromebook.
With the Linux environment
- Open Settings → About ChromeOS → Developers (on older versions, Settings → Advanced → Developers) and turn on the Linux development environment. It downloads a Debian container; allow a few minutes.
- Open the Terminal app and run
ssh-keygen -t ed25519 -C "you@chromebook". Accept the default file,~/.ssh/id_ed25519, and choose a passphrase. - Show the public key with
cat ~/.ssh/id_ed25519.puband copy the one line it prints to GitHub (Settings, SSH and GPG keys) or to the server’s~/.ssh/authorized_keys. - Connect with
ssh user@hostfrom the same Terminal.
If the Developers section is missing or the switch is greyed out, your administrator has disabled Linux, and the route below is the one open to you. Developer mode, which some guides suggest, wipes the Chromebook and is not available at all on a managed one.
Without Linux
ChromeOS has no terminal of its own for SSH, but Google publishes the Secure Shell extension in the Chrome Web Store, which connects over SSH from a browser tab and accepts imported identity files. What it does not have is a command to generate a key. So the key has to be made somewhere and imported.
- Open SSHKEY, choose Ed25519, type a comment and a passphrase, and make the key pair.
- Save the private key and the
.pubfile to the Chromebook’s Downloads folder, or anywhere you can reach from the Files app. - Copy the public key line and add it to GitHub, GitLab, or the server’s
authorized_keys. - In Secure Shell’s connection dialogue, use Import beside the identity list and choose both files; the extension keeps a copy of them. Then pick that identity when connecting.
Keep the private key off shared drives and cloud folders; anyone with the file and the passphrase can sign in as you. That is why the passphrase matters on a Chromebook shared at school or at home.
What SSHKEY actually makes
The key is generated by WebCrypto’s generateKey, the browser’s built-in cryptography, which draws on the operating system’s random number generator. SSHKEY then writes the private key in OpenSSH’s own format (the file beginning -----BEGIN OPENSSH PRIVATE KEY-----), locked with your passphrase by bcrypt_pbkdf and AES-256 as ssh-keygen locks it, and the public key as the single line ssh-ed25519 AAAA… comment, with its SHA256 fingerprint shown so you can compare it with what GitHub or the server displays. Nothing about the key is sent anywhere, and nothing is kept once the tab is closed.
Ed25519 in WebCrypto needs a recent browser: Chrome and Edge 137 or later, Firefox 129, Safari 17. A Chromebook on current ChromeOS has it. On an older one the list starts at ECDSA, which works with GitHub and almost every server; RSA at 3072 bits or more is there for old systems that accept nothing else.
Making the key and seeing its fingerprint is free. Saving the key files is part of OBSCURA Pro, or US$1 to save from one tool for a day; on a Chromebook with Linux, ssh-keygen costs nothing, and we would use it.
Check the fingerprint
When you add the public key to GitHub it shows a SHA256 fingerprint; so does SSHKEY, and so does ssh-keygen -lf on the file. They should match. The first time you connect to a server, it shows you the server’s fingerprint in turn, which is the one to check against what the server’s owner publishes. How to check an SSH key fingerprint covers both directions.
Questions people ask about How to make an SSH key on a Chromebook, with or without Linux
How do I generate an SSH key on a Chromebook?
Turn on the Linux development environment in Settings, open Terminal and run ssh-keygen -t ed25519. If Linux is disabled, make the key pair in the browser with SSHKEY and import it into the Secure Shell extension.
Can I use SSH on a school Chromebook without Linux?
Often, yes. Google's Secure Shell extension connects over SSH from a browser tab and accepts imported keys, if your administrator allows the extension. It cannot generate keys, so make the pair elsewhere and import it.
How do I add an SSH key to the Secure Shell extension?
In the connection dialogue, use Import beside the identity list and choose the private key and its .pub file. Then select that identity for the connection.
Is it safe to generate an SSH key in a browser?
If the key is made in the page by the browser's own cryptography and never sent anywhere, it is generated the same way a native tool would, from the operating system's random number generator. Check that the page makes no network requests, and protect the key with a passphrase.
Which SSH key type should I use?
Ed25519, unless a system asks for something else. Use ECDSA if the browser cannot make Ed25519, and RSA of 3072 bits or more only for old systems.
Where is the Linux option on a Chromebook?
In Settings, About ChromeOS, Developers, or on older versions Settings, Advanced, Developers. If it is missing or greyed out, the administrator has disabled it.
Related
- A password manager with no account and no cloudWhat a vault is underneath, what you get by having no account, and the four things you give up, starting with sync and ending with recovery.
- Password protect a PDF, and what protects nothingA PDF can carry two passwords and only one is security. What AES-256 does, why an owner password stops nobody, and what removing a password can and cannot mean.
- Password protect a zip, and what it still gives awayTwo kinds of zip password, one broken since 1994. Why Windows will not open the good kind, and what the file names tell anyone holding the archive.
- Sign a PDF, and which signature you needAn image, an electronic signature with an integrity record, and a certificate-based digital signature are three different things.
- Send a file without it sitting on a serverEncrypt it to the recipient's public key, or hand it over directly between two browsers.
All 11 guides under “Locking it, signing it and handing it over”.
A letter, now and then
An occasional letter when there is something worth reading: the new guides and what changed in the tools. Never more than once a month and nothing else, and you can leave at any time on the unsubscribe page.