An open API service indexing awesome lists of open source software.

https://github.com/bytedream/docker4ssh

πŸ‹ Docker containers and more via ssh
https://github.com/bytedream/docker4ssh

container docker ssh

Last synced: about 1 month ago
JSON representation

πŸ‹ Docker containers and more via ssh

Awesome Lists containing this project

README

        

# 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](https://github.com/ByteDream/docker4ssh/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](https://github.com/ByteDream/docker4ssh/wiki/Configuration-Files#profileconf)
- Containers are configurable from within
- Re-login into existing containers
- Full use of the docker api (unlike [docker2ssh](https://github.com/moul/ssh2docker), which uses the cli, which theoretically could cause code injection)
- Highly configurable [settings](https://github.com/ByteDream/docker4ssh/wiki/Configuration-Files#docker4sshconf)

## ⌨️ 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](https://github.com/ByteDream/docker4ssh/releases/latest).
```shell
$ RELEASE=; 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](https://go.dev/) installed
- [Rust](https://www.rust-lang.org/) installed
- [Make](https://www.gnu.org/software/make/) installed - optional, but highly recommended since we use `make` in the further instructions

To install docker4ssh, just execute the following commands
```shell
$ git clone https://github.com/ByteDream/docker4ssh
$ cd docker4ssh
$ make build
$ make install
```

- Install it from the [AUR](https://aur.archlinux.org/packages/docker4ssh/) (if you're using arch or an arch based distro)
```shell
$ yay -S docker4ssh
```

## πŸ–‹ Usage

To start the docker4ssh server, simply type
```shell
$ docker4ssh start
```

The default port for the ssh server is 2222, if you want to change it take a look at the [config file](https://github.com/ByteDream/docker4ssh/wiki/docker4ssh.conf).
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:
```shell
$ 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:
```shell
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](https://github.com/ByteDream/docker4ssh/wiki).

## βš– License

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