This article explains what you need to do when the Secure Copy (SCP) utility fails with the "subsystem request failed on channel 0 scp: Connection closed" error.
You will observe the following "scp: Connection closed" error while performing a Secure Copy (SCP) operation:
> scp <source> <destination>subsystem request failed on channel 0scp: Connection closed
The "subsystem request failed on channel 0 scp: Connection closed" error is related to compatibility issues between SCP and SFTP.
To work around the error, use the flag -O with scp to make the command work.
Example:
scp -O <source> <destination>
Use the legacy SCP protocol (-O) for file transfers instead of the SFTP protocol. At times, you will need to force the use of the legacy SCP protocol for servers that do not implement SFTP, for backward compatibility with particular filename wildcard patterns, and for expanding paths with a ~ prefix for older SFTP servers.
2026-02-09: Minor, non-technical modifications made for search optimization
2025-04-13 : Article Created