V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Mandy0
V2EX  ›  Linux

请问大佬们我这个 ssh 为什么连接不上

  •  
  •   Mandy0 · 2019-04-28 18:08:55 +08:00 · 3581 次点击
    这是一个创建于 2045 天前的主题,其中的信息可能已经有所发展或是发生改变。

    初接触 Linux,172.16.1.146 是被连接的主机,系统是 BT5,下面是另一台主机连接失败输出的内容,在 Windows 下用 putty 也连接不上,希望大家帮忙分析一下原因。

    [root@centos7 ~]# ssh -vvv 172.16.1.146
    OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 58: Applying options for *
    debug2: resolving "172.16.1.146" port 22
    debug2: ssh_connect_direct: needpriv 0
    debug1: Connecting to 172.16.1.146 [172.16.1.146] port 22.
    debug1: Connection established.
    debug1: permanently_set_uid: 0/0
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_rsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_rsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_dsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_dsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_ecdsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_ecdsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_ed25519 type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /root/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_7.4
    debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7
    debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH_5* compat 0x0c000000
    debug2: fd 3 setting O_NONBLOCK
    debug1: Authenticating to 172.16.1.146:22 as 'root'
    debug3: send packet: type 20
    debug1: SSH2_MSG_KEXINIT sent
    Connection closed by 172.16.1.146 port 22
    
    

    下面两张图是 BT5 sshd_config 的截图 BT5 sshd_config

    sshd_config

    6 条回复    2019-04-30 10:22:22 +08:00
    imdong
        1
    imdong  
       2019-04-28 18:15:34 +08:00
    debug1: key_load_public: No such file or directory
    PbCopy111
        2
    PbCopy111  
       2019-04-29 09:17:50 +08:00
    你是怎么验证登陆 ssh 的?
    Mandy0
        3
    Mandy0  
    OP
       2019-04-29 09:23:18 +08:00
    @PbCopy111 我直接 ssh 172.16.1.146 密码验证
    51Tao
        4
    51Tao  
       2019-04-29 12:14:43 +08:00
    没有运行 root 的密码登录吧?
    Mandy0
        5
    Mandy0  
    OP
       2019-04-29 17:19:41 +08:00
    @51Tao 我 ssh root@目标主机 IP 也是一样
    kim959501
        6
    kim959501  
       2019-04-30 10:22:22 +08:00
    1. ssh-key 生成了吗?文件权限配置正确?
    2. ssh 验证方式是什么?密码 or key
    3. 是否禁用了 root 登录
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1042 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 20:25 · PVG 04:25 · LAX 12:25 · JFK 15:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.