Shell In A Box – Web-Based SSH Terminal for Linux Access

Shell In A Box – Web-Based SSH Terminal for Linux Access

- 2 mins

Shell In A Box – Web-Based SSH Terminal for Linux Access

Shell In A Box (or shellinabox) is a web-based terminal emulator developed by Markus Gutschke. It features a built-in web server that allows users to access and control their Linux server via SSH using a browser with AJAX, JavaScript, and CSS support—without requiring additional plugins like FireSSH.

This guide covers installing and configuring Shellinabox for secure SSH access through a web browser, especially useful when access is limited to HTTPS traffic due to firewall restrictions.


Installing Shellinabox

Shellinabox is available in the default repositories of Debian-based Linux distributions and can be installed with the following command:

Install on Debian, Ubuntu & Mint:

$ sudo apt install openssl shellinabox

siab

Configuring Shellinabox

By default, Shellinabox runs on TCP port 4200 and listens on localhost. To enhance security, you can change the default port to a random one, such as 6161. A self-signed SSL certificate is automatically created in /var/lib/shellinabox to facilitate HTTPS connections.

Modify the configuration file:

$ sudo vi /etc/default/shellinabox

Update the following lines:

# Start shellinaboxd automatically
SHELLINABOX_DAEMON_START=1

# Set Shellinabox to listen on port 6175
SHELLINABOX_PORT=6161

# Disable beep sounds
SHELLINABOX_ARGS="--no-beep"

# Define SSH server IP
OPTS="-s /:SSH:192.168.1.175"

# Restrict access to localhost if needed
OPTS="-s /:SSH:192.168.1.175 --localhost-only"

siab

After editing, restart and verify the service:

$ sudo systemctl restart shellinabox
$ sudo systemctl status shellinabox

siab

To check if Shellinabox is running on the specified port:

$ sudo netstat -nap | grep shellinabox

Firewall Configuration (If You have FW)

Ensure that the firewall allows traffic through the chosen port (6175).

On Debian, Ubuntu & Mint:

$ sudo ufw allow 6175/tcp
$ sudo ufw allow from 192.168.1.175 to any port 6161

Accessing Linux SSH Terminal via Browser

Open your web browser and navigate to:

https://Your-IP-Address:6161

Log in with your Linux username and password to access the SSH terminal.

siab

Additional Features

Right-click within the terminal to customize the interface and access additional options.

siab

For more details, visit the official Shellinabox GitHub repository.




Thanks for reading…





:+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1:


Guneycan Sanli.


Guneycan Sanli

Guneycan Sanli

A person who like learning, music, travelling and sports.

comments powered by Disqus