This is an ssh server that is hosted inside of a docker container based on Alpine Linux.
I'm slowly hardening this ssh server by following some tips from here.
The image on docker hub under adamveld12/ssh-server
uses the Vagrant insecure keypair. Maybe this would be useful to you if you want to use an image for a local dev environment or some for testing.
build.sh
to generate a root ssh key and build an image taggedssh-server
.- Spin up the container with
docker run -d -p 2222:22 ssh-server
. connect.sh
orssh root@${docker-machine ip default} -p 2222 -i ./keys/id_rsa
to connect to your container.
You can replace the id_rsa.pub
in ./keys
to whatever public key you want. build.sh
will prompt to overwrite ./keys
if they already exist, so you don't have to worry about overwriting it accidentally.
MIT