Home  >  Q&A  >  body text

docker容器呢SSH为什么连不通呢?

#apt-get install openssh-server openssh-client
#mkdir /var/run/sshd   
#ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
#ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
#/usr/sbin/sshd 


我ssh localhost

我的试了我创建ssh生成的密码,也重新设置了root的密码,用root密码登陆都不行,求教这是怎么回事额,弄了一早晨了···

某草草某草草2757 days ago852

reply all(3)I'll reply

  • 滿天的星座

    滿天的星座2017-04-25 09:05:47

    Try it ssh root@localhost ?或者是没有指定端口号吧,试一试ssh root@localhost -p <PORT>

    reply
    0
  • 習慣沉默

    習慣沉默2017-04-25 09:05:47

    I don’t understand the question. Did you run a Docker container on a host and then use SSH to log in to the Docker container on the host?

    reply
    0
  • 高洛峰

    高洛峰2017-04-25 09:05:47

    docker ps -a Check the machine IP, ssh + ip access,
    In addition, root may prohibit remote login by default

    reply
    0
  • Cancelreply