容器ssh配置
- 启动容器
docker run -it -p 2222:22 ubuntu
- 更新
apt update
- 配置密码
passwd
- 安装openssh-server
apt install openssh-server
- 配置ssh
echo "UsePAM no" >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
- 启动ssh
service ssh start
ssh连接容器
ssh root@localhost:2222
文章来源地址https://uudwc.com/A/oLRAL
文章来源:https://uudwc.com/A/oLRAL