在Filezilla出现received unexpected end-of-file from SFTP server 解决方法

导语:叶子使用filezilla的sftp方式登录一内网服务器的时候,出现什么密钥不匹配的提示(提示没看清),叶子点击了更新密钥,登录的时候出现received unexpected end-of-file from SFTP server。

解决方法

登陆目标主机,使用 cat 查看 /etc/ssh/sshd_config 文件,找到 Subsystem 关键字。

cat /etc/ssh/sshd_config

# override default of no subsystems
Subsystem       sftp    /usr/local/openssh-7.5p1/libexec/sftp-server

查看目标文件即 /usr/local/openssh-7.5p1/libexec/sftp-server 是否存在。

ls /usr/local/openssh-7.5p1/libexec/sftp-server
ls: cannot access /usr/local/openssh-7.5p1/libexec/sftp-server: No such file or directory

文件不存在,将其更改为有效文件并重启 sshd 服务

vi /etc/ssh/sshd_config

...
# override default of no subsystems
#Subsystem      sftp    /usr/local/openssh-7.5p1/libexec/sftp-server
Subsystem      sftp    /usr/libexec/openssh/sftp-server
...

重启sshd服务。

service sshd restart

Restarting sshd (via systemctl):                           [  OK  ]

结束

你学会了吗?其实和那个什么密钥不匹配没有关系额,是一个服务器ssh配置的问题。

发表评论

邮箱地址不会被公开。 必填项已用*标注