You should make a run.sh file and put the following content:
docker run --rm -p 8022:22 \
--name deb-ssh \
uisleandro/ssh:debian-v8.10
After you must run:
echo "" > id_rsa && \
docker exec deb-ssh cat /root/.ssh/id_rsa >> id_rsa
At this point you must have a private key which will give you access to the container, if you are using linux you can try the following command:
ssh-keygen -f "/home/$USER/.ssh/known_hosts" -R [127.0.0.1]:8022 && \
ssh [email protected] -v -p 8022 -i id_rsa
If you want to change the current private-key to another one you must run, (from outside the container) and then run the 2nd and 3rd steps:
docker exec deb-ssh ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa
docker exec deb-ssh cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys
Content type
Image
Digest
Size
24 MB
Last updated
over 8 years ago
docker pull uisleandro/ssh