Guides HOWTO: Install a secured web shell

plex_noob

Blitz Legioner
Original poster
Staff
Donor
220
95
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

Blitz 3rd Class
Donor
21
3
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
 

plex_noob

Blitz Legioner
Original poster
Staff
Donor
220
95
You python version seems to be outdated. Another possibility is deprecated libraries.
 
  • Like
Reactions: JaksLax

JaksLax

Blitz 3rd Class
Donor
21
3
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?
 

JaksLax

Blitz 3rd Class
Donor
21
3
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

Blitz 3rd Class
Donor
21
3
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.
 
Assists Greatly with Development Costs

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.


Development Donations

 

Members online

Trending