If you need to connect to a remote server, SSH is the best way to do it. Not enough people know this, but users who have a Chromebook can use SSH to establish connections with remote Linux servers as well.

Setting up SSH on a Chromebook is easy and only takes a few clicks.

Using the Chrome SSH Extension

The simplest way to set up SSH on your Chromebook is by installing the Secure Shell extension. This extension supersedes the Chrome SSH app. While the latter is still available for Chromebook users on the Web Store, it will go away for regular users in 2021 and enterprise users in 2022.

Instead, you can install the Secure Shell Chrome extension. It works like the old app and any other remote terminal apps like PuTTY, which you might have used on other operating systems like Windows. You can also use any SSH keys you've generated in the Chromebook Linux environment. More on that below.

To set up a connection, click the Secure Shell logo and a menu will pop up. Click the Connect Dialog option. A menu will appear asking you to enter the parameters that you'll use to connect to your server, including the address of the server and your username. If you've created an SSH key on another computer, you can import it using the Import button.

Chrome SSH app

Once you've filled in your information and successfully logged in to your remote server, you can start your connection anytime by clicking on it from the menu.

This extension also supports Mosh sessions. Mosh is excellent because you can stay connected even when your wireless connection drops or you close your laptop. Just click the stylized Mosh option and a menu similar to the connection setup menu will be displayed. Just put in the same information you filled in earlier and you'll have a Mosh connection from your browser.

Using SSH Under Linux

A more flexible option on a Chromebook is to use SSH under Linux if your device supports it. This way, you won't have to rely on any browser extension for connecting to a remote server.

If you haven't already set up the Linux environment under Chrome OS, open Settings and go to Developers > Linux Development Environment (beta). Chrome OS will set up a Debian Linux environment known as Crostini.

Chrome OS Linux menu

Chrome OS 103 and higher have an interface where you launch the terminal and new tabs that let you set up commonly-used servers.

Chromebook Linux SSH setup menu

To add a server, just click Add SSH and fill in your username and the address of your server, as well as other options, in the appropriate fields. As with the extension, if you have an SSH key, you can also add it.

If you've generated a key using the Linux environment, you can find it in Files under My Files > Linux > .ssh > id_rsa. If you don't see anything starting with ".", click More (the one with the three dots) and then click Show Hidden Files. To use a key, select it from the drop-down menu.

If you haven't set up an SSH key, you can do so using the instructions in the next section.

With the SSH server connection set up, you can just click on it and launch an SSH session.

As an alternative, you can also start SSH from the Chromebook Linux command line. This is good for one-off SSH sessions. From the menu, click on Penguin to start the shell. You can then log in as you would on any other Linux command line:

        ssh user@server
    
Chromebook Linux crostini running SSH

Just replace user and server in the aforementioned command with your username and the address of the server you're trying to connect to. If your username on your local machine and the remote machine are the same, you can omit the username, as SSH will just assume that your local username is the same on the remote server.

You can also launch Mosh the same way, though you'll have to install it separately in Linux:

        sudo apt install mosh
    

Once that's set up, you can just call Mosh from the command line:

        mosh user@server
    

Generating an SSH Key on Chromebooks

One of the most powerful features of SSH is the ability to generate a public/private key pair that lets you log in to your remote server more securely than just using a password alone or logging in without a password at all.

The key pair works on the principle of a private and public key. The private key is unique to your computer and stays on your machine. As the name suggests, you should keep it private. On the other hand, you can copy the public key to remote servers.

To generate a key, type:

        ssh-keygen
    

This will create the key pair. You'll also be prompted to enter a passphrase. It should be more complex than a password. Alternatively, you can just leave it blank.

ssh-keygen Linux command

To copy the public key to the server, use the ssh-copy-id command:

        ssh-copy-id server user@server
    

You can also manually copy and paste your public key on the remote server. Your public key is located at .ssh/id_rsa.pub. Copy the contents of this file to the .ssh/authorized_keys file on the remote server. Using ssh-copy-id is much easier and faster than manually copying the key pair.

You'll then be able to log in to the server with your passphrase. If you opted to leave the passphrase blank, you'd be able to log in without a password.

You Can SSH From Your Chromebook

You now know how to log in to a remote server with SSH from a Chromebook by either using a browser extension or with the standard SSH client in Linux.

To unleash the real power of remote sessions, you can set up Mosh and Tmux together. This will not only make remote computing much easier but will also allow you to run terminal processes without worrying about them too much.