docker容器ubuntu系统,ssh connection refused,访问不了
- 安装更新ssh服务器
sudo apt-get install openssh-server
- 开启ssh服务
sudo service ssh start
3.设置开机自启ssh服务
sudo systemctl enable ssh
3.1禁止开机启动ssh
sudo systemctl disable ssh
4.检查是否设置成功
sudo systemctl status ssh
在Docker的Ubuntu容器中遇到SSH连接被拒绝的问题,可以尝试安装openssh-server,然后启动并设置开机启动SSH服务。使用sudoservicesshstart启动SSH,用sudosystemctlenablessh设为开机启动。要检查SSH状态,输入sudosystemctlstatusssh。如果需要禁用开机启动,可执行sudosystemctldisablessh。
316

被折叠的 条评论
为什么被折叠?



