标签:
1. Dockerfile -->docker build -t centos6-ssh https://git.oschina.net/feedao/Docker_shell/raw/start/Dockerfile
2. login --------->
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install openssh-server
ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key
sed -ri ‘s/session required pam_loginuid.so/
mkdir -p /root/.ssh && chown root.root /root && chmod 700 /root/.ssh
echo ‘root:123456‘ | chpasswd
3.docker run -d -p 50001:22 centos-ssh /usr/sbin/sshd -D
标签:
原文地址:http://www.cnblogs.com/baxk/p/5165381.html