search

Home  >  Q&A  >  body text

linux - The newly installed centos7 server fails to connect remotely using ssh locally?

The external IP of the ping server is accessible.
But the telnet IP 22 port is not accessible.
Use

There is also port 22 listening.
But I can’t connect using ssh + ip.

伊谢尔伦伊谢尔伦2809 days ago780

reply all(3)I'll reply

  • 黄舟

    黄舟2017-05-16 13:20:38

    Try turning off the firewall, service firewalld stop

    reply
    0
  • 黄舟

    黄舟2017-05-16 13:20:38

    Generally the firewall is turned on for newly installed systems. To turn off the firewall, run service iptables stop or add a firewall policy to open port 22

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 13:20:38

    Maybe the firewall is causing trouble, you can directly use the following command to turn off the firewall and selinux under centos7 2

    setenforce 0
    sed -i.bak "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
    systemctl disable firewalld.service
    systemctl stop firewalld.service
    iptables --flush

    reply
    0
  • Cancelreply