Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
89
rated 0 times [  89] [ 0]  / answers: 1 / hits: 289233  / 3 Years ago, sun, may 30, 2021, 6:08:46

I've searched all around and can't seem to find this... I'm trying to copy a private key to my local machine which is a Mac.



When I fire up terminal on my mac, I get
Jamies-iMac:~ jamie$



So after I ssh into my Ubuntu server I tried



scp /path/to/myfile.txt jamie@Jamies-iMac:/path/to/myfile.txt


which gives me:



ssh: Could not resolve hostname Jamies-iMac: Name or service not known
lost connection


In place of jamie@Jamies-iMac:/path/to/myfile.txt I've tried some other variations but nothing seems to work. Thanks for your help.


More From » ssh

 Answers
1

@ovc had it right, but there is a syntax error, and my edit got rejected for some reason. You need to have a colon between the user and filepath on the ubuntu side, and on the mac side you need to have the /Users/username/ portion in the filepath. Like so:



scp [email protected]:/path/to/myfile.txt /Users/Jamie/local/path/to/myfile.txt


This assumes you have private key authentication set up.


[#30583] Tuesday, June 1, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
needstar

Total Points: 268
Total Questions: 108
Total Answers: 117

Location: Seychelles
Member since Mon, Jun 28, 2021
3 Years ago
;