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

bytedream/docker4ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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:latest@127.0.0.1

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:latest@127.0.0.1'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.