https://github.com/byjg/docker-openssh-server
Docker OpenSSH Server Image / Bastion
https://github.com/byjg/docker-openssh-server
bastion docker docker-openssh-server openssh-server
Last synced: 2 months ago
JSON representation
Docker OpenSSH Server Image / Bastion
- Host: GitHub
- URL: https://github.com/byjg/docker-openssh-server
- Owner: byjg
- Created: 2018-10-07T01:46:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-03T01:49:23.000Z (almost 6 years ago)
- Last Synced: 2025-03-28T14:37:14.719Z (6 months ago)
- Topics: bastion, docker, docker-openssh-server, openssh-server
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker OpenSSH Server Image
This image runs a Simple OpenSSH Server. You can use it as a Bastion server.
# Command Line
```bash
docker run \
--rm \
-p 2222:22 \
-e SSH_PUBLIC_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB...oOZRfcqYs4JPQgxpZ public-key" \
--name openssh-server \
-d byjg/openssh-server
```# Docker Compose
```yaml
version: '3.4'services:
ssh:
image: byjg/openssh-server
environment:
- SSH_PUBLIC_KEY=ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB...oOZRfcqYs4JPQgxpZ public-key
ports:
- 2222:22
```# Passing more than one public key
Just add `SSH_PUBLIC_KEY` variables followed by 1, 2, 3.
```bash
docker run \
--rm \
-p 2222:22 \
-e SSH_PUBLIC_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB...oOZRfcqYs4JPQgxpZ public-key" \
-e SSH_PUBLIC_KEY1="ssh-rsa CCCCCC4AbCed12ECCCCCCCCCCCCC...hja9ajhskjhasjkla public-key" \
-e SSH_PUBLIC_KEY2="ssh-rsa DDDDE5ua8AjajFDDDDDDDDDDDDDD...aha2ujaja81jggaaa public-key" \
--name openssh-server \
-d byjg/openssh-server
```# Accessing the container
Because security purposes the user `root` is not allowed to login. Instead you have
to login with the user `user````bash
ssh -p 2222 user@
```