Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Latest commit

 

History

History
107 lines (89 loc) · 4.62 KB

README.md

File metadata and controls

107 lines (89 loc) · 4.62 KB

docker4ssh - docker containers and more via ssh

docker4ssh is an ssh server that can create new docker containers and re-login into existing ones.

Code size Latest commit Download Badge License Release Discord

✨ Features · ⌨ Installation · 🖋️ Usage · ⚖ License

Visit the wiki to get more information and detailed usage instructions

✨ Features

  • Create containers by images (e.g. ubuntu:21.04@server)
  • Create specific containers for specific usernames with profiles
  • Containers are configurable from within
  • Re-login into existing containers
  • Full use of the docker api (unlike docker2ssh, which uses the cli, which theoretically could cause code injection)
  • Highly configurable settings

⌨️ Installation

For every install method your OS must be linux and docker has to be installed.

  • From the latest release (currently only x64 architecture supported)

    Replace the RELEASE value in the following oneliner with the latest release version.

    $ RELEASE=<latest version>; curl -L https://github.com/ByteDream/docker4ssh/releases/download/v$RELEASE/docker4ssh-$RELEASE.tar.gz | tar -xvzf - -C /
  • Building from source

    Before start installing, make sure you have to following things ready:

    • Go installed
    • Rust installed
    • Make installed - optional, but highly recommended since we use make in the further instructions

    To install docker4ssh, just execute the following commands

    $ git clone https://github.com/ByteDream/docker4ssh
    $ cd docker4ssh
    $ make build
    $ make install
  • Install it from the AUR (if you're using arch or an arch based distro)

    $ yay -S docker4ssh

🖋 Usage

To start the docker4ssh server, simply type

$ docker4ssh start

The default port for the ssh server is 2222, if you want to change it take a look at the config file. Dynamic profile generation is enabled by default, so you can start right away. Type the following to generate a new ubuntu container and connect to it:

$ ssh -p 2222 ubuntu:[email protected]

You will get a password prompt then where you can type in anything since by default any password is correct. If you typed in a password, the docker container gets created and the ssh connection is "redirected" to the containers' tty:

ubuntu:[email protected]'s password: 
┌───Container────────────────┐
│ Container ID: e0f3d48217da │
│ Network Mode: Host         │
│ Configurable: true         │
│ Run Level:    User         │
│ Exit After:                │
│ Keep On Exit: false        │
└──────────────Information───┘
root@e0f3d48217da:/#

For further information, visit the wiki.

⚖ License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for more details.