Public | Automated Build

Last pushed: 8 months ago
Short Description
SSH Daemon (CentOS7 & Supervisor)
Full Description

#SSH Daemon (CentOS 7 & Supervisor)

million12/ssh docker image with SSHD running under CentOS 7 and Supervisor.


to be able to connect user can provide port and password for root user. Please see examples below.


docker run \
    -d \
    --name ssh \
    -p 10022:22 \

if root passoword is not provided image will generate one and it can be retrived from logs

docker logs ssh
[SSHD 09:49:22] root password set to: ota7zohsh0AZu2Ex

Login using that password:

ssh -p 10022
root@docker.ip's password: ota7zohsh0AZu2Ex

Environmental Variable

ROOT_PASS = root user password

Custom Password deployment


docker run \
    -d \
    --name ssh \
    -p 10022:22 \
    --env="ROOT_PASS=my_pass" \

Docker troubleshooting

Use docker command to see if all required containers are up and running:

$ docker ps -a

Check online logs of ssh container:

$ docker logs ssh

Attach to running ssh container (to detach the tty without exiting the shell,
use the escape sequence Ctrl+p + Ctrl+q):

$ docker attach ssh

Sometimes you might just want to review how things are deployed inside a running container, you can do this by executing a bash shell through docker's exec command:

docker exec -i -t ssh /bin/bash

History of an image and size of layers:

docker history --no-trunc=true million12/ssh | tr -s ' ' | tail -n+2 | awk -F " ago " '{print $2}'


Author: Przemyslaw Ozgo (

Sponsored by - the new prototyping tool for building highly-interactive prototypes of your website or web app. Built on top of TYPO3 Neos CMS and Zurb Foundation framework.

Docker Pull Command
Source Repository

Comments (2)
2 years ago


TBH I have never faced PAM problem with this build or any of my own images :)

But for me your Dockerfile is way to complex. I would rather add all of those thing to and run it inside the container when you first run it. Same way we do this with our million12/centos-supervisor image.

In /data/init you put any *.sh script and it will be run before supervisor kicks in. So all permissions would be set before your aplication is called by supervisor. By doing this you limit the number of layers you have in your image.

Another thing is that I wouldn't printf all of those lines in this file. Use command ADD or COPy before run and add your file there and sed only what you need to change ;)

If you want more help contact me on my email

2 years ago


Thanks for shariing this image. This is very very useful. I have a question though. I tried to write a brand new Dockerfile, using info from here. I have made some heavy changes in my Dockerfile. You can see it at longwuyuan / ssh-ttyjs-centos7 .

My question is that I could not login until I disabled PAM (as you can see in my Dockerfile). Did you face this problem. If yes, how did you solve it. Because I think I have used exactly the same procedure as you and other ssh images of CentOS and the PAM causes ssh login failure.

Thanks & regards,
; Madhusudan