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
Find and Remove Files with Space Using Find Command on Linux
Replace a Text with a Variable
Perf Stat Does Not Count Memory-Loads But Counts Memory-Stores
How Do Locales Work in Linux/Posix and What Transformations Are Applied
Process Command Line in Linux 64 Bit
In Linux, How to Test Whether the Output of a Program Is Going to a Live Terminal or to a File
Sorting Numbers with Multiple Decimals in Bash
How to Get a Part of the Output of a Command in Linux Bash
How to Find Out What Linux Capabilities a Process Requires to Work
Print on Terminal and into File Simultaneously
Is There Any Shortcut to Reference the Path of the First Argument in a Mv Command
Find and Replace Text in a File Between Range of Lines Using Sed