无法通过 SSH 使用任何东西(除了 Putty)连接到远程 Centos 7 服务器

问题描述 投票:0回答:1

除了 Putty 之外,无法通过 SSH 连接到远程 Centos 7 服务器。 Filezilla 和 WinSCP 不起作用,从 Linux 文件管理器连接也不起作用,但从 Putty 进行连接以及从 Linux 终端连接却可以正常工作。附:我以 root 身份连接。

WinSCP 日志显示已授予访问权限,但此后连接就冻结了。

WinSCP日志(我已更改IP和域名):

. 2023-11-20 22:51:57.412 Looking up host "domain.com" for SSH connection
. 2023-11-20 22:52:01.893 Connecting to 1.1.1.1 port 22
. 2023-11-20 22:52:03.383 Connected to 1.1.1.1
. 2023-11-20 22:52:03.403 We claim version: SSH-2.0-WinSCP_release_6.1.1
. 2023-11-20 22:52:03.403 Connected to 1.1.1.1
. 2023-11-20 22:52:08.541 Remote version: SSH-2.0-OpenSSH_7.4
. 2023-11-20 22:52:08.541 We believe remote version has SSH-2 RSA/SHA-2/certificate userauth bug
. 2023-11-20 22:52:08.541 Using SSH protocol version 2
. 2023-11-20 22:52:08.543 Have a known host key of type ssh-ed25519
. 2023-11-20 22:52:11.593 Doing ECDH key exchange with curve Curve25519, using hash SHA-256
. 2023-11-20 22:52:12.572 Server also has ecdsa-sha2-nistp256/rsa-sha2-512/rsa-sha2-256/ssh-rsa host keys, but we don't know any of them
. 2023-11-20 22:52:12.577 Host key fingerprint is:
. 2023-11-20 22:52:12.598 ssh-ed25519 255 SHA256:K9vXpoV7PxwfgCO6lcud0jj022ZoMAY0/otC/MzDOEw
. 2023-11-20 22:52:12.643 Host key matches cached key
. 2023-11-20 22:52:12.643 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] outbound encryption
. 2023-11-20 22:52:12.643 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2023-11-20 22:52:12.643 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] inbound encryption
. 2023-11-20 22:52:12.643 Initialised HMAC-SHA-256 inbound MAC algorithm
! 2023-11-20 22:52:12.843 Using username "root".
. 2023-11-20 22:52:13.073 Server offered these authentication methods: publickey,password
. 2023-11-20 22:52:13.073 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2023-11-20 22:52:13.073 Using stored password.
. 2023-11-20 22:52:13.143 Sent password
. 2023-11-20 22:52:13.413 Access granted
. 2023-11-20 22:52:13.413 Opening main session channel
. 2023-11-20 22:52:13.903 Opened main channel
. 2023-11-20 22:52:30.932 Waiting for data timed out, asking user what to do.
. 2023-11-20 22:52:30.932 Asking user:
. 2023-11-20 22:52:30.932 **Host is not communicating for 15 seconds.
. 2023-11-20 22:52:30.932 
. 2023-11-20 22:52:30.932 Wait for another 15 seconds?** ()

SSHD 配置:

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

SyslogFacility AUTHPRIV

PermitRootLogin yes
MaxAuthTries 6

AuthorizedKeysFile      .ssh/authorized_keys

PasswordAuthentication yes

ChallengeResponseAuthentication no

GSSAPIAuthentication no
GSSAPICleanupCredentials yes

UsePAM yes

AllowAgentForwarding yes
AllowTcpForwarding yes

X11Forwarding yes

X11UseLocalhost no

TCPKeepAlive yes

ClientAliveInterval 20
ClientAliveCountMax 99999

UseDNS no

AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS

Subsystem      sftp     internal-sftp

尝试连接时的安全日志(我已将 IP 更改为 1.1.1.1):

Nov 20 23:26:18 eagle1050 sshd[14882]: Accepted password for root from 1.1.1.1 port 65195 ssh2
Nov 20 23:26:18 eagle1050 sshd[14882]: pam_unix(sshd:session): session opened for user root by (uid=0)
Nov 20 23:26:36 eagle1050 sshd[14882]: pam_unix(sshd:session): session closed for user root
centos openssh winscp sshd
1个回答
0
投票

通过更新 OpenSSH 解决

© www.soinside.com 2019 - 2024. All rights reserved.