- systemctl start 不能使用
容器里面不运行后台服务
Failed to get D-Bus connection: Operation not permitted
- 以特权模式运行容器
docker run --name centos7 -i -t -d -p 7022:22 -p 7080:80 --privileged=true centos:7 /usr/sbin/init
docker exec -it centos7 /bin/bash
- 安装openssh
yum install -y openssh
- 安装openssh-server
yum install -y openssh-server
- 安装openssh-clients
yum install -y openssh-clients
- centos7 启动openssh
systemctl restart sshd
- centos6 启动openssh
/etc/init.d/sshd start