docker ssh: connect to host localhost port 22: Cannot assign requested address

原因

sshd服务还没有开启

docker 里面的centos,service和systemctl都不好用。

  1. /usr/sbin/sshd-keygen -A
  2. /usr/sbin/sshd

不在报错

  1. 设置免密登录
    ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
    cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
    chmod 0600 ~/.ssh/authorized_keys

你可能感兴趣的:(docker ssh: connect to host localhost port 22: Cannot assign requested address)