技术解析

请问大佬们我这个 ssh 为什么连接不上
0
2021-06-21 01:47:23
idczone

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

[[email protected] ~]# 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


debug1: key_load_public: No such file or directory

你是怎么验证登陆 ssh 的?

我直接 ssh 172.16.1.146 密码验证

没有运行 root 的密码登录吧?

我 ssh [email&IP 也是一样

1. ssh-key 生成了吗?文件权限配置正确?
2. ssh 验证方式是什么?密码 or key
3. 是否禁用了 root 登录

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服