小编Clo*_*One的帖子

Docker 容器 ssh 错误:ssh_exchange_identification:连接被远程主机关闭

我正在尝试设置一个 Ubuntu 容器,openssh-server以便我可以从主机 ssh 进入它。我知道这不是标准的做法,但我真的很想这样做ssh

\n\n

这是我的Dockerfile

\n\n
# Select base image\nFROM ubuntu:16.04\n\n# Set the current working directory\nWORKDIR /home\n\n# Update the system, download any packages essential for the project\nRUN dpkg --add-architecture i386\nRUN apt-get update && apt-get upgrade -y\nRUN apt-get install -y git build-essential make gcc vim net-tools iputils-ping ca-certificates openssh-server libc6:i386 libstdc++6:i386\n\n# Allow ssh root login\nRUN echo "root:root" | chpasswd\n\n# RUN rpl "PermitRootLogin prohibit-password" "PermitRootLogin yes" /etc/ssh/sshd_config\nRUN sed -i \'s/prohibit-password/yes/\' /etc/ssh/sshd_config\n\nRUN cat /etc/ssh/sshd_config\nRUN mkdir /root/.ssh\n\nRUN …
Run Code Online (Sandbox Code Playgroud)

linux ssh openssh ubuntu docker

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

docker ×1

linux ×1

openssh ×1

ssh ×1

ubuntu ×1