SSH server running on Ubuntu inside Docker
616
SSH server running on Ubuntu inside Docker. Docker Hub page.
Latest Ubuntu LTS running SSH daemon inside.
docker run -d -e SSH_PUBLIC_KEYS="<key>" peru/ubuntu_sshd
or
docker run -d -e SSHD_PORT="22" -e SSH_PUBLIC_KEYS="<key1>\n<key2>\n<key3>..." peru/ubuntu_sshd
docker run -it --rm -p 2222:22 -e SSH_PUBLIC_KEYS="$(cat ~/.ssh/id_rsa.pub)\n$(cat ~/.ssh/ssh_keys/id_rsa.pub)\n$(cat ~/.ssh/ssh_keys/my.pub)" peru/ubuntu_sshd
or
PUBLIC_KEY=`cat ~/.ssh/id_rsa.pub`
docker run -it --rm -p 2222:22 -e SSH_PUBLIC_KEYS="$PUBLIC_KEY" peru/ubuntu_sshd
After that, run ssh [email protected] -p 2222 to access it.
Thanks to panubo/docker-sshd
Content type
Image
Digest
Size
59 MB
Last updated
almost 7 years ago
docker pull peru/ubuntu_sshd