Discussion HOWTO: Install a secured web shell

  • Guest - 7.5 will focus on bug fixing for all the containers including wiki writeup. Thanks to those who tested 7.4 (which will continue to receive minor updates). 7.5 should not be anything radical or drastic (unlike PGBox and PGClone).

plex_noob

PG Ambassador
Tech Support
Oct 1, 2018
76
62
Brussels
Reactions
62 0 0
#1
PG Version
Any
Server Type
Remote - Dedicated Server
Hi,

This is a small explanation of how to access the secured shell of your server through a web interface. It uses the excellent work from the project ShelInABox.
Due to the security risks linked to this container I would suggest putting 2 level of control:
- A Traefik authentication as explained in this HOWTO
- A strong user password

Follow this howto to use the docker-compose.yml file

Code:
---
version: '2'
services:
  shellinabox:
    image: sspreitzer/shellinabox:latest
    restart: always
    container_name: siab
    labels:
      traefik.enable: "true"
      traefik.frontend.auth.basic.users: "[Hash generated from this procedure]"
      traefik.frontend.headers.customResponseHeaders: "X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex"
      traefik.frontend.redirect.entryPoint: "https"
      traefik.frontend.rule: "Host:siab.[domain.name],"
      traefik.port: "4200"
    ports:
      - "4200:4200"
    volumes:
      - /:/PG
    environment:
      - "SIAB_ADDUSER=true"
      - "SIAB_USER=siab"
      - "SIAB_USERID=9000"
      - "SIAB_GROUP=guest"
      - "SIAB_GROUPID=9000"
      - "SIAB_PASSWORD=[Strong Password]"
      - "SIAB_SHELL=/bin/bash"
      - "SIAB_HOME=/home/siab"
      - "SIAB_SUDO=true"
      - "SIAB_SSL=false"
networks:
  default:
    external:
      name: plexguide
 

JaksLax

PG Veteran
PG Donor
Jul 6, 2018
17
5
Reactions
5 0 0
#2
I ran sudo docker-compose -f /opt/app/data/shellinabox/docker-compose.yml up -d after following the directions you linked to and pasted your text into the docker-compose.yml. I got this error below. What am I doing wrong?

/usr/local/lib/python2.7/dist-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.

warnings.warn(warning, RequestsDependencyWarning)

Traceback (most recent call last):

File "/usr/bin/docker-compose", line 9, in <module>

load_entry_point('docker-compose==1.8.0', 'console_scripts', 'docker-compose')()

File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point

return get_distribution(dist).load_entry_point(group, name)

File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point

return ep.load()

File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2229, in load

return self.resolve()

File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2235, in resolve

module = __import__(self.module_name, fromlist=['__name__'], level=0)

File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 17, in <module>

from ..bundle import get_image_digests

File "/usr/lib/python2.7/dist-packages/compose/bundle.py", line 14, in <module>

from .service import format_environment

File "/usr/lib/python2.7/dist-packages/compose/service.py", line 13, in <module>

from docker.utils import LogConfig

ImportError: cannot import name LogConfig
 

JaksLax

PG Veteran
PG Donor
Jul 6, 2018
17
5
Reactions
5 0 0
#6
You python version seems to be outdated. Another possibility is deprecated libraries.
So it looks like I have both python 3.5.2 and python 2.7.12 installed on my server, and docker keeps wanting to use the python 2.7.12 version. How do I force it to use the 3.5.2 version?
 
Assists Greatly with Development Costs

JaksLax

PG Veteran
PG Donor
Jul 6, 2018
17
5
Reactions
5 0 0
#7
So it looks like I have both python 3.5.2 and python 2.7.12 installed on my server, and docker keeps wanting to use the python 2.7.12 version. How do I force it to use the 3.5.2 version?
Worked through that python issue, but now seeing
pkg_resources.DistributionNotFound: The 'docker-compose==1.8.0' distribution was not found and is required by the application
 

JaksLax

PG Veteran
PG Donor
Jul 6, 2018
17
5
Reactions
5 0 0
#8
Worked through that python issue, but now seeing
pkg_resources.DistributionNotFound: The 'docker-compose==1.8.0' distribution was not found and is required by the application
Please ignore, running as sudo fixed that issue, and now its installed. Cant wait to try it out.
 

PG Developer Donations

 

Forum statistics

Threads
2,365
Messages
14,360
Members
4,825
Latest member
lankanrebel