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

2019-04-28 18:08:55 +08:00
 Mandy0

初接触 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 的截图

3495 次点击
所在节点    Linux
6 条回复
imdong
2019-04-28 18:15:34 +08:00
debug1: key_load_public: No such file or directory
PbCopy111
2019-04-29 09:17:50 +08:00
你是怎么验证登陆 ssh 的?
Mandy0
2019-04-29 09:23:18 +08:00
@PbCopy111 我直接 ssh 172.16.1.146 密码验证
51Tao
2019-04-29 12:14:43 +08:00
没有运行 root 的密码登录吧?
Mandy0
2019-04-29 17:19:41 +08:00
@51Tao 我 ssh root@目标主机 IP 也是一样
kim959501
2019-04-30 10:22:22 +08:00
1. ssh-key 生成了吗?文件权限配置正确?
2. ssh 验证方式是什么?密码 or key
3. 是否禁用了 root 登录

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/559550

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX