Scp on OSX does not allow spaces in user names?

I need ssh in windows 7 to run MobaSSH as its SSH daemon, and the username in the windows window contains space. I can enter a Windows 7 window on an OSX terminal, for example:

ssh "Some User"@WindowsHost

So, I thought I could use the scp command on OSX to transfer files between computers, but I always get the error "invalid username" when I do something like this:

scp myfile "Some User"@WindowsHost:~/myfile

I looked through it and found https://stackoverflow.com/a/3776266/2126 , but basically this is the space in the file path.

I found an error posted about this problem in a specific version of scp , but I'm not sure how to fix scp on OSX. The patch is offered as a .c file.

My last resort is to create a new username in a Windows 7 window and transfer all my profile settings to this new user. It seems like this is a real problem when I can login via ssh but not scp.

Any tips?

+5
source share
3 answers

Add custom configuration to your ssh Mac user configuration, usually in ~ / .ssh / config

Host mySpaceyUsernameHost
User "Some User"
HostName WindowsHost

Then you can execute the scp file using the specified configuration:

scp myfile mySpaceyUsernameHost:~/myfile

I just tried this on OS X 10.7 (Lion) and it worked from one Mac to another, while the other options (quoted or scrolling off the screen) are not ... so there is something.

+9
source

Have you tried Some\ User@WindowsHost? Shielded space may work if there is no error in scp.

7 ?

+2

Replace spaces with underscores:

scp file "User Name@host":

becomes

scp file User_Name@host:

Work with scpLinux on Mac OS X.

0
source

All Articles