docker centos7 ssh
- 在容器上执行
- yum install passwd openssl openssh-server -y
- ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N ‘‘
- ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ‘‘
- ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key -N ‘‘
- 修改 /etc/ssh/sshd_config 配置信息:
- UsePAM yes 改为 UsePAM no
- UsePrivilegeSeparation sandbox 改为 UsePrivilegeSeparation no
- 修改完后,重新启动sshd
- /usr/sbin/sshd -D&
- 修改root密码就可以进行ssh登录了
- passwd root
docker centos7 容器上安装ssh
来源: http://www.bubuko.com/infodetail-2356770.html