容器多了,用命令(docker exec)進入容器以爲太麻煩, 爲了不麻煩,筆者在docker容器安裝了ssh. 因而出現瞭如下錯誤.docker
080836fadc3a ~# /etc/init.d/sshd start
bash-4.3# ssh root@192.168.1.54 root@192.168.1.54's password: Last login: Tue Jul 5 06:51:12 2016 from 192.168.1.46 Connection to 192.168.1.54 closed. bash-4.3# #登錄後自動退出容器.
080836fadc3a ~# vim /etc/ssh/sshd_config PermitRootLogin yes UsePAM no 080836fadc3a ~# /etc/init.d/sshd restart
bash-4.3# ssh root@192.168.1.54 080836fadc3a ~#