This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
Shellinabox
shellinabox allows access to the command-line from web based terminal emulator. It is useful for web-based administrator access to a system. It is accessible to any JavaScript and CSS enabled web browser and does not require any additional browser plugins.[1].
Connections to shellinaboxd are not secure unless SSL/TLS certificates have been installed or generated.
Installation
USE flags
Emerge
root #
emerge --ask www-misc/shellinabox
Configuration
Securing the connection
The default configuration exposes a login shell with SSL disabled on the localhost interface only.
Information about the procedure for generating self-signed SSL certificates is explained here.
To generate an SSH certification for use shellinabox the following commands can be issued:
root #
cd /etc/shellinabox/cert
root #
openssl genrsa -des3 -out server.key 1024
root #
openssl req -new -key server.key -out server.csr
root #
cp server.key server.key.org
root #
openssl rsa -in server.key.org -out server.key
root #
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
root #
cat server.crt server.key > certificate.pem
For Gentoo user convenience, the ebuild maintainer has provided the above commands in a file located here: /etc/shellinabox/cert/gen_ssl_cert.bash
This script can simply be executed in order to generate the SSL certificate:
root #
cd /etc/shellinabox/cert
root #
bash gen_ssl_cert.bash
Service
OpenRC
Add the service to the default runlevel:
root #
rc-update add shellinaboxd default
Start the service now:
root #
rc-service shellinaboxd start
systemd
To start the service at boot:
root #
systemctl enable shellinaboxd
Start the service now:
root #
systemctl start shellinaboxd
Usage
After the service is running, open a web browser to the IP address of the system and port 4200
:
user $
firefox http://localhost:4200
Invocation
root #
shellinaboxd --help
Removal
Unmerge
root #
emerge --ask --depclean www-misc/shellinabox
See also
- bash — the default shell on Gentoo systems and a popular shell program found on many Linux systems.
- ssh — an encrypted terminal program that replaces the classic telnet tool on Unix-like operating systems.
External resources
https://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ - A guide on setting up shellinabox.