https://github.com/kool-dev/docker-sshd
Docker Image for sshd
https://github.com/kool-dev/docker-sshd
docker hacktoberfest kool kool-dev kooldev sshd
Last synced: 4 months ago
JSON representation
Docker Image for sshd
- Host: GitHub
- URL: https://github.com/kool-dev/docker-sshd
- Owner: kool-dev
- License: mit
- Created: 2020-10-02T17:49:22.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-17T02:40:28.000Z (almost 5 years ago)
- Last Synced: 2025-03-17T23:51:37.447Z (7 months ago)
- Topics: docker, hacktoberfest, kool, kool-dev, kooldev, sshd
- Language: Shell
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# kool-dev/docker-sshd

Very simple docker image for running a SSH Server based on Alpine.
Username will be created with suffix that end the env `AUTHORIZED_KEYS_` converted to lowercase, or by suffix that file name `authorized_keys_`
* Adding and env variable `AUTHORIZED_KEYS_USERNAME`
* Mounting a file at `/authorized_keys_username`## Usage
### Env Variable
```bash
AUTHORIZED_KEYS=$(cat authorized_keys.txt)docker run --rm --init -p22:22 -e AUTHORIZED_KEYS_USER1=${AUTHORIZED_KEYS} -e AUTHORIZED_KEYS_USER2=${AUTHORIZED_KEYS} kooldev/sshd
```This example will create `/home/retool/.ssh/authorized_keys` and `/home/kool/.ssh/authorized_keys`
### Mount File
```bash
docker run --rm --init -p22:22 -v "$(pwd)/authorized_keys_user1:/authorized_keys_user1" -v "$(pwd)/authorized_keys_user2:/authorized_keys_user2" kooldev/sshd
```That's it, now you can ssh in:
```
ssh kool@localhost
```