Coder Social home page Coder Social logo

simhaonline / lxd_shell_provider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jjcella/lxd_shell_provider

0.0 0.0 0.0 66 KB

One-time LXC container provider (via LXD API) (SSH proxy server) - For educational purposes only

Python 100.00%

lxd_shell_provider's Introduction

Diagramm

Requirements

  • LXD
  • LVM / BTRFS / ZFS as container storage backend
  • Python 3.4+
  • Python packages described in requirements.txt

Installation

  1. Configure your pool (we are using LVM) and linux bridge for your containers by running lxd init
  2. Create a container, it will be your base container for the LXC pool
  3. Install openssh-server inside the container and configure users
  4. (Optional) Create a snapshot (ready-only snapshot as a base container is better) of your container
  5. Change the source field in config/container.json to your container name (or snapshot name). Check https://lxd.readthedocs.io/en/latest/instances/ for more informations on LXD instance configuration
  6. Copy config/container_ssh.json.example to config/container_ssh.json and configure it. This file describe informations used to connect to LXD containers via SSH.
  7. Configure config/server.json - It describe SSH Server behaviors
  8. Generate private RSA key and save it as private.pem
  9. Run sshproxy.py

Installation details (Debian 10)

LXD installation

$ apt install snapd python3 python3-pip lvm2
$ snap install lxd

LXD initialization

$ lxd init
$ lxc storage set vgname volume.size 500MB

Base container creation

$ lxc launch images:debian/buster/amd64 debian-base
$ lxc snapshot debian-base snap

$ lxc exec debian-base /bin/bash
$ apt update && apt install openssh-server -y
$ passwd root
$ adduser debian

$ git clone https://github.com/JJCella/lxd_shell_provider
$ cd lxd_shell_provider
Configure json files (see 5-6-7)
$ openssl genrsa -out private.pem 2048 $ pip3 install -r requirements.txt
$ python3 sshproxy.py

lxd_shell_provider's People

Contributors

jjcella avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.