If you manage a remote Ubuntu server, your standard method of access is likely a dedicated SSH client like PuTTY on Windows or the native Terminal app on macOS. However, there are times when you might need to access your server from a restricted environment, such as a corporate office network that blocks standard SSH ports (Port 22), or from a public library computer where installing third-party software is impossible.
In these situations, the best solution is to run your terminal directly inside a standard web browser. By installing a lightweight utility called shellinabox on your Ubuntu server, you can access a fully functional, interactive shell session using nothing but Google Chrome, Firefox, or Safari over a standard web protocol.
This guide explains how to install, configure, and securely access shellinabox on Ubuntu.
Step 1: Install Shellinabox
Before you begin, you must have standard SSH access to your server to perform the initial installation.
- Connect to your Ubuntu server via your normal SSH client.
- Update your package lists to ensure you download the latest version:
sudo apt update - Install the software:
sudo apt install shellinabox
Once the installation completes, the shellinabox daemon will automatically start running in the background.
Step 2: Access the Terminal in Your Browser
By default, shellinabox listens for incoming web connections on port 4200. It also generates a self-signed SSL certificate automatically to ensure your keystrokes (and passwords) are encrypted in transit, rather than sent as plain text.
- Open a web browser on your local computer.
- In the address bar, type
https://followed by your server’s IP address, followed by:4200. For example:https://192.168.1.50:4200 - Because the SSL certificate is self-signed (meaning it was generated by your server, not a trusted authority like Let’s Encrypt), your browser will display a massive security warning stating “Your connection is not private” or “Warning: Potential Security Risk Ahead.” This is normal for self-signed certificates.
- Bypass the warning by clicking Advanced, then selecting Proceed to 192.168.1.50 (unsafe).
The screen will turn black, and a standard Ubuntu login prompt will appear directly in your web browser. Type your username and password, and you will have full access to your server’s terminal.
Step 3: Secure the Configuration (Optional but Recommended)
While the default setup works, running an exposed terminal on port 4200 is not ideal for public-facing servers. It is highly recommended that you change the default port to something less obvious to avoid automated bot scanners.
- In your terminal (either via SSH or via the new web interface), open the configuration file:
sudo nano /etc/default/shellinabox - Look for the line that specifies the port:
SHELLINABOX_PORT=4200 - Change
4200to a random, unused high port number (e.g.,8443or61234). - Save the file and exit Nano (press
Ctrl+O,Enter, thenCtrl+X). - Restart the service to apply the new port:
sudo systemctl restart shellinabox
Make sure you update your server’s firewall (such as UFW) to allow incoming traffic on your newly selected port. From now on, you can access your server’s command line from any web browser in the world, completely bypassing the need for dedicated SSH software.