-
Notifications
You must be signed in to change notification settings - Fork 2
Home
This document descriptions how to set up Shell in a Box in a Docker container for use with the Terminal Icon extension for Plesk.
We're going to use Nginx to proxy the HTTPS URL for simplicity and to allow Plesk to manage the SSL (TLS) certificate.
- Requirements
- Add Shell in a Box Docker Container
- Create Proxy Link
- Block HTTP Access
- Install and Configure Terminal Icon Extension
This extension requires the Docker extension for Plesk (the free version is fine). If you do not already have it installed, download the extension or install via the Plesk Extensions admin menu.
I chose the sspreitzer/shellinabox image because it is convenient to use with Plesk (necessary options are exposed via environmental variables).
Pull the sspreitzer/shellinabox
image and add a container as you normally would in Plesk's Docker interface. When prompted for container settings, configure accordingly:
- You may set the Exposed Port to any available port, or allow Plesk to assign one. Make note of the port for later.
- The SIAB_SERVICE service must be set to the fully-qualified domain name of your server (recommended) or its IP address. Example:
/:SSH:plesk1.mydomain.com
- (optional) By default, Shell in a Box has a white background with black test. If you prefer more traditional black background with white test, you can set the SIAB_USERCSS as follows:
Normal:+/etc/shellinabox/options-enabled/00_White-On-Black.css
The rest of the fields may be left as default.
When finished with configuration, click OK and allow the container to be started. You can test if everything is working correctly by visiting the URL of your server with the exposed port from above:
http://<host_name_or_ip>:<exposed_port>
In order to access the Shell in a Box instance through HTTPS, create an Nginx proxy in Plesk.
Important: If you choose not to create a proxy link, you'll need to figure out how to secure the Shell in a Box instance yourself. The URL must be accessed via HTTPS for this extension to work.
Note: Regardless of what URL you choose as the proxy link, make sure that HTTPS is enabled! (either via Let's Encrypt or your own certificate).
- Click on the domain that you want to use as the proxy URL.
- For existing domains, you can create a proxy as a sub-folder (ex:
https://mydomain.com/terminal
). - If you prefer to use a sub-domain, create a new sub domain for the primary domain is Plesk (ex:
https://terminal.mydomain.com
).
- For existing domains, you can create a proxy as a sub-folder (ex:
- Click the Docker Proxy Rules link.
- Click the Add Rule button.
- Configure as follows:
-
URL - Enter the sub-folder that you would like to use for the proxy link (ex:
https://mydomain.com/terminal
), or if you created a sub-domain, leave blank to access from the sub-domain root. - Container - Choose the Shell in a Box Docker container created earlier.
- Port - Make sure that the exposed port that was associated with the container is selected (it should be selected by default as there is only one).
-
URL - Enter the sub-folder that you would like to use for the proxy link (ex:
- Click OK to add the proxy link.
Make sure that the Docker container is started and test the link you created by visiting it in a browser. Examples:
Sub-folder: https://plesk1.mydomain.com/terminal/
Sub-domain: https://terminal.mydomain.com/
If everything is configured correctly, the Shell in a Box terminal window should appear.
You may wish to block the original non-HTTPS URL. You can do this in your firewall of choice.
For example, in Ubuntu:
ufw deny <exposed_docker_port>
ufw reload
If you are using a different Linux distro/firewall, see the vendor's instructions on how to block ports.
- Download the latest release of the extension ZIP file.
- Upload the extension in Plesk as you normally would.
- Go to the extension's settings page.
- Add the Shell in a Box URL that you created in the Create Proxy Link section above.
- Click OK to save settings.
When you click on a domain in the Plesk control panel, you should now see an icon labeled "Terminal (SSH)".