Skip to content

Instantly share code, notes, and snippets.

@gasi
Created June 1, 2013 20:04
Show Gist options
  • Save gasi/5691565 to your computer and use it in GitHub Desktop.
Save gasi/5691565 to your computer and use it in GitHub Desktop.
Setting up an SSH server on @dotcloud docker CentOS image
# Install OpenSSH server and SSH client
yum install -y openssh-server
yum install -y openssh-clients
# Install passwd
yum install -y passwd
# Set root password
passwd
# TODO: Enter new root password
# TODO: Repeat new root password
# Test ssh
ssh root@localhost
# Enter root password when prompted
# ERROR: Connection to localhost closed.
# ERROR: Exit status 254
@larrycai
Copy link

larrycai commented Jul 3, 2014

I guess this PAM setting is not needed since docker 1.0.0

@JulesWang
Copy link

PAM setting is not needed +1

@ernetas
Copy link

ernetas commented Feb 7, 2015

PAM setting is still needed (Docker 1.4, phusion/baseimage:latest). -1

@stoleas
Copy link

stoleas commented Oct 18, 2015

For automating the passwd part

( sleep .1 ; printf "%s\n" "password" "password" ) | passwd

Then password could be easily editable through other means using Jinja during deployment or something...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment