以root權限進入到docker后重啓ssh服務即可重啓ssh服務: docker exec -it -u root [容器号] /bin/bash 重啓ssh服務: service ssh restart