1. 程式人生 > >本機機器ssh docker容器

本機機器ssh docker容器

https://blog.csdn.net/u010324465/article/details/77184506

1、在docker中安裝openssh-server

2、sudo /etc/init.d/ssh start 啟動服務

3、檢視啟動成功與否 ps -e|grep ssh

4、$sudo vim/etc/ssh/sshd_config

PermitRootLogin without-password 改為 PermitRootLogin yes`

PasswordAuthentication yes 改為 PasswordAuthentication no 5、重啟ssh sudo service ssh restart 6、passwd root 設定密碼 7、ifconfig 檢視容器例項ip 8、ssh ip