Tags and Dockerfiles
ssh-server for Docker
SSH Server that can be used for port forwarding or serving files. This can be useful when doing development or testing with
--net=host and the docker host is not accessible to your local machine.
# generate ssh key. ssh-keygen -t rsa -f id_rsa.key -N '' # start container docker run --name ssh -d --net host -v "id_rsa.key.pub":/etc/ssh/keys/id_rsa.key.pub:ro danisla/ssh-server:latest # SSH and forward ports. ssh -f -N -i ./id_rsa.key -L 8080:localhost:8080 nobody@<docker host ip>
start.sh script sets up the user and group, chowns the data dir and starts
sshd_config is setup to read the authorized_keys file dynamically using the provided
/usr/local/bin/get_keys.sh script so public keys just need to be mounted into the container at runtime.
UID of ssh user, default is
GID of ssh user, default is
User name of ssh user, default is
Home directory of ssh user, default is
Directory in container where authorized public key files (