zoukankan      html  css  js  c++  java
  • ssh无法登录,提示Connection closing...Socket close.

    一、问题无法ssh直接连接到服务器

    [C:~]$ ssh 192.168.7.77
    
    Connecting to 192.168.7.77:22...
    Connection established.
    To escape to local shell, press 'Ctrl+Alt+]'.
    Connection closing...Socket close.
    
    Connection closed by foreign host.
    
    Disconnected from remote host(192.168.7.77:22) at 16:51:19.

    二、问题原因及解决方法

    sshd的配置,自己的IP地址没有加入到hosts.allow配置文件中,而hosts.deny则拒绝了除allow外的所有主机登录。

    解决方法:把自己的IP地址加入到hosts.allow文件中,并重启sshd服务。

    # ll /etc/hosts.*
    -rw-r--r-- 1 root root 767 Jan  2  2017 /etc/hosts.allow
    -rw-r--r-- 1 root root 888 Aug 15  2016 /etc/hosts.deny
    # grep -Ev '#' /etc/hosts.deny 
    sshd:all
    # grep -Ev '#' /etc/hosts.allow 
    sshd:192.168.7.100/255.255.255.255
  • 相关阅读:
    ANT安装
    MAVEN配置教程
    闲笔
    js系列
    微信小程序系列_require
    c++复习系列
    codeblocks系列
    mysql系列
    Google Developer Tools
    数学建模算法(三):神经网络
  • 原文地址:https://www.cnblogs.com/cyleon/p/10553279.html
Copyright © 2011-2022 走看看