docker pull centos:centos7.9.2009
docker images
docker run -itd --name=centos --privileged=true -p 3333:22 centos:centos7.9.2009 /usr/sbin/init
docker ps
docker exec -it centos /bin/bash
yum install openssh* -y
systemctl restart sshd
systemctl status sshd
passwd root
exit
外部连接ip:3333即可
标签:sshd,centos,3333,centos7.9,systemctl,docker,运行 From: https://www.cnblogs.com/guowenrui/p/17618004.html