Escape space in a username an SCP command

35 views Asked by At

This post shows how to transfer a folder from a remote Windows to a local Linux. In particular, this command:

scp -r username@hostname:/path/from/remote /path/to/local

My remote machine is a Windows 11 with a username having space like this nice guy. This is my attempt:

scp -r "nice guy"@xxx.xxx.xxx.xx:\C:\path\to\folder /home/linux_username/Downloads

But I get an error:

nice guy: Invalid username

How do I escape the space in the Windows username?

0

There are 0 answers