【发布时间】:2020-02-29 18:46:37
【问题描述】:
我尝试从我的 Windows 主机 ssh 到 docker ubuntu 容器。我知道,我可以使用docker exec -it <container-name> /bin/bash 启动,但是,我想做一个普通的“ssh root@192.168.xx.xx”来登录,因为我想模拟远程计算机登录,而且它也很容易与我的 pycharm 一起使用。
但是,在我安装“openssh-server”并启动它之后,仍然无法从我的主机使用 ssh 登录。
:~$ ssh root@192.168.99.105
>>> The authenticity of host '192.168.99.105 (192.168.99.105)' can't be established.
ECDSA key fingerprint is SHA256:********
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.99.105' (ECDSA) to the list of known hosts.
root@192.168.99.105's password: xxx
Permission denied, please try again.
我该如何解决这个问题?我只想简单地 ssh 到这个容器...
【问题讨论】:
-
你需要先配置ssh,我觉得你应该搜索allow root login
-
谢谢,但是你知道我在哪里可以配置 ssh 以允许 root 登录吗?
-
您应该将 Docker 容器视为单个应用程序的包装器,而不是您通常在其中获取交互式 shell 的东西。例如,您如何 ssh 到您的 Web 浏览器?跨度>
-
嗨@DavidMaze 我只是简单地在我的窗口上使用“docker quick start”终端。