Friday, August 1, 2014

How to create Docker image with OpenSSH

http://flnkr.com/2013/12/creating-a-docker-ubuntu-13-10-image-with-openssh/

I’ve posted the stephens/sshd image to the docker site and  you can download it with the command: (The root password is password.)
> docker pull stephens/sshd

To run an instance of the image as a daemon, execute:
> docker run -d -p 22 stephens/sshd

To run the image in the foreground and enter the shell, execute:
> docker run -i -t -p 22 stephens/sshd /bin/bash

To connect to the image, first find the port that was assigned to the ssh port and then connect with the ssh client:
> docker ps
> ssh root@localhost -p 

No comments: