Reputation: 7383
I am on a mac and I have sshed into a remote computer, A. I want to transfer a file from A to my mac.
I tried scp myfile.txt myusername:
I got an error:
ssh: Could not resolve hostname {myusername}: Name or service not known.
How do I fix this?
I got my username by typing id -un
Upvotes: 0
Views: 1981
Reputation: 191
The right syntax would be.. From remote computer A, you have to run the following command
scp myfile.txt yourusername@<ip_addr or hostname of your mac>:/dest/path
Or instead from your mac, you can run the below command without logging in the remote machine
scp remoteusername@remotecomputerA:/path/to/myfile.txt ./
Upvotes: 2