Sftp on Linux Server Gives Error "Received Message Too Long"

SFTP on linux server gives error Received message too long

Configure your server to use the internal sftp server adding the following directive to /etc/ssh/sshd_config:

Subsystem sftp internal-sftp

That way, it will not use the user shell to launch the sftp server program.

sftp fails with 'message too long' error

Here's a quick-n'-dirty solution, but it seems to work - also on binary files. All credits goes to uvgroovy.

Given file 'some-file.txt', just do:

cat some-file.txt | ssh root:1.1.1.1 /bin/bash -c "cat > /root/some-new-file.txt"

Still, if anyone know a sftp/scp built-in way to do so on client side, it'll be great.

Getting Received too large SFTP packet when logging in with Root using WinSCP to Google Compute Engine virtual machine instance

Hmmm, I added this in WinSCP in advanced settings under "protocol options":
sudo /usr/lib/openssh/sftp-servers

I can login with my own username and move files now. Although not exactly sure how this works, I think it somehow changes you to root user at login?

More info: https://winscp.net/eng/docs/faq_su

SFTP server containing error with message as ssh_exchange_identification: read: Connection reset by peer

You may have been blocked by server, so server may drop the connection in this case. For finding the root cause here, server-side logs will help.
Connection reset by peer means the TCP stream was abnormally closed from the other end.

Node.js ssh2-sftp-client Error: fastPut: No response from server Local

The reason for the problem is that the connection is closing before the finish of executing fastPut.

You are running connect, after that in the first .then, the method fastPut runs asynchronously, it doesn't wait for the finish execution and return undefined to the next method .then of the chain.

To solve the problem you just need to return a promise received from fastPut

sftp.connect(config)
.then(() => sftp.fastPut(localPath, remotePath))
.then((data) => {/* do something*/}
.finally(() => sftp.end())


Related Topics



Leave a reply



Submit