Simple nologin ssh server used for port forwarding.
405
latest (Dockerfile)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>
The entrypoint start.sh script sets up the user and group, chowns the data dir and starts sshd.
The 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 1000
GID of ssh user, default is 1000
User name of ssh user, default is nobody
Home directory of ssh user, default is /tmp
Directory in container where authorized public key files (*.pub) live.
Content type
Image
Digest
Size
86.9 MB
Last updated
over 10 years ago
docker pull danisla/ssh-server