wscp收到了太大的SFTP包,支持的最大包大小1024000 B

wscp收到了太大的SFTP包,支持的最大包大小1024000 B

我的ubuntu服务器升级了一些包后,winscp无法连到服务器,报以下错。
在这里插入图片描述
在网上找了好久,各种方案在我手里都不好用。比如删除 ~/.profile 和 ~/.bashrc 里所有东西,还是解决不了这个问题。

解决方案是,改一下配置文件
vim /etc/ssh/sshd_config

注释这行
#Subsystem sftp /usr/lib/openssh/sftp-server
增加一行为
Subsystem sftp internal-sftp

重启ssh服务或服务器。就解可以用winscp连了。

我从以下两个地址打到的解决方案
https://unix.stackexchange.com/questions/61580/sftp-gives-an-error-received-message-too-long-and-what-is-the-reason
https://www.zhihu.com/question/421105440

还有一个临时解决方案如下
在winscp官方找到以下文档,最后一条对我有用。

To fix the problem, find out, what command in your login script prints the text. Once you find it, move the command to a proper interactive script, or remove it entirely. The scripts are usually hidden (their name starts with dot) and are located in your home directory on the server. Typically you will need to move the commands from .bashrc script to .bash_profile.
这个英文我理解大概意思是删除.bashrc 里的注释,或将 注释移到.bash_profile 里。这个对我不好用。

There are other possible sources of the message in addition to the profile script – some SSH servers print messages, if they are unable to start an SFTP server, or encounter a fatal error. You should contact your server administrator.
这条我没理解咋解决。

Another possibility is that the server is configured to only allow an SCP protocol and not the SFTP protocol, in such a way that SCP fallback mechanism of WinSCP does not work. The solution is to explicitly choose SCP protocol on the Login dialog.
我的解决方案在这最后一条中。

the server is configured to only allow an SCP protocol and not the SFTP protocol
服务配置只允许scp协议,而不是sftp协议。
The solution is to explicitly choose SCP protocol on the Login dialog.
解决方案是选择scp协议登陆。

如下箭头处,选择scp协议,就可以正常登陆了。
在这里插入图片描述

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值