scp on Windows 11

Today I struggled quite a bit to successfully run scp on Windows 11 and copy files to a remote SFTP server. It took quite some research to try and find out (without results) why the scp command was hanging up on a line like the following (with -v enabled):

[...]
debug1: Sending command: scp -v -t path/

The weird thing is that the same command would work perfectly on Linux, so it was definitely a Windows issue. My gut feeling was that scp was not using the SFTP subsystem, but there was no -s option (like in its Linux counterpart) to force its usage.

Running ssh -V returned version 8.6. Knowing that SFTP is the default protocol starting from OpenSSH 9.0, I decided to upgrade OpenSSH. Luckily, the latest versions of OpenSSH include an MSI installer to make installation easier.

In a nutshell, this is what I had to do:

After the update, scp ran without issues.

#tech #windows