• home > OS > Linux > Devops >

    ssh_exchange_identification: Connection closed by remote host

    Author:zhoulujun Date:

    网站更换端口后,由原来的22端口改为8081端口。发现死活无法登录了 一直报错:ssh_exchange_identification: Connection closed by remote host。谷歌搜索的方法试了还是不行,只有

    我网站更换端口后,由原来的22端口改为8081端口。发现死活无法登录了

    一直报错:ssh_exchange_identification: Connection closed by remote host

    重新查看 配置文件,并增加22端口

    vim /etc/ssh/sshd_config
    systemctl restart sshd

    找到Port ,增加22 53322端口

    还是不行,以为selinux 问题

    让selinux 给ssh 放行自定义端口

    semanage port -a -t ssh_port_t -p tcp 8081

    完成后再次查看 ssh 使用的端口,可以发现 8081 端口已经添加:

    semanage port -l|grep ssh

    但是,发现还是不行:

    防火墙先增加端口再说

    firewall-cmd --permanent --add-port=10086/tcp
    systemctl restart firewalld.service
    firewall-cmd --list

    还是不行。哔了狗了

    google 搜索了下,排在首位的是 

    https://serverfault.com/questions/1015547/what-causes-ssh-error-kex-exchange-identification-connection-closed-by-remote

    其它几篇,还是没有搞出来

    然后切换wifi,连接主机手机分享的wifi,居然可以了

    但是问题还是没有得到解决。

    请大佬分析



    转载本站文章《ssh_exchange_identification: Connection closed by remote host》,
    请注明出处:https://www.zhoulujun.cn/html/OS/Linux/LinuxDevops/8599.html