我尝试从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到这个容器...