Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kabirbaidhya/fakeserver
https://hub.docker.com/r/kabirbaidhya/fakeserver/
https://github.com/kabirbaidhya/fakeserver
docker fake fakeserver integration-testing mock server ssh sshd test
Last synced: 2 months ago
JSON representation
https://hub.docker.com/r/kabirbaidhya/fakeserver/
- Host: GitHub
- URL: https://github.com/kabirbaidhya/fakeserver
- Owner: kabirbaidhya
- License: mit
- Created: 2018-10-17T19:17:33.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-31T15:56:45.000Z (about 6 years ago)
- Last Synced: 2024-10-11T02:14:29.833Z (3 months ago)
- Topics: docker, fake, fakeserver, integration-testing, mock, server, ssh, sshd, test
- Language: Shell
- Size: 14.6 KB
- Stars: 18
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fakeserver
A docker container to emulate a remote server for testing. The primary purpose is to emulate and test running automated scripts and utilities over ssh in remote servers.
https://hub.docker.com/r/kabirbaidhya/fakeserver/
Uses https://github.com/panubo/docker-sshd as a base image to run OpenSSH `sshd` service.
## Quick Spin Up
Set it up
```bash
➜ git clone https://github.com/kabirbaidhya/fakeserver.git
➜ cd fakeserver
➜ cat ~/.ssh/id_rsa.pub > .authorized_keys
```
Run the server
```bash
➜ ./up.sh
```Test it out
```bash
➜ ssh app@localhost -p 2222
```
## Custom UsagePull the image.
```bash
➜ docker pull kabirbaidhya/fakeserver
```Set authorized keys for the server.
```bash
➜ cat ~/.ssh/id_rsa.pub > /path/to/authorized_keys
```Run the fakeserver.
```bash
➜ docker run -d -p 2222:22 \
-v "/path/to/authorized_keys:/etc/authorized_keys/tester" \
-e SSH_USERS="tester:1001:1001" \
--name=fakeserver kabirbaidhya/fakeserver
```You can now use the fakeserver from any ssh client. For instance:
```bash
# SSH to the server
➜ ssh tester@localhost -p 2222# Run a command in the server
➜ ssh tester@localhost -p 2222 "echo 'Hello World'"
```