0

I am using scp command to copy file from a MacBook Pro OS X 10.5 to another Linux box (Red Hat Linux Enterprise 5).

I am using the following command on Mac, sudo scp ~/.ssh/mykey.rsa testuser@10.10.100.101, there is no output from Mac command line. I am not sure whether the scp is success or not. Where is the location the file mykey.rsa on remote computer 10.10.100.101?

thanks in advance, George

George2
  • 5,169

1 Answers1

5

The mykey.rsa file has been renamed to testuser@10.10.100.101 on the Mac. It has not been copied to the 10.10.100.101 machine at all.

It's because the destination address wasn't in the correct format. When using scp, any filename that refers to another machine must be specified in the following format:

username@host:path

The colon between the user@host and path is important. Without the colon, scp will not treat it as an address of another machine and will instead assume it's just an oddly-formatted local filename.

To copy the mykey.rsa file, you should probably use a command like

scp ~/.ssh/mykey.rsa testuser@10.10.100.101:.ssh/mykey.rsa
Barry Brown
  • 1,950