tags:

views:

112

answers:

2

I run unsuccessfully

curl $Masi@host:~/folder
curl: (6) Couldn't resolve host 'host:~'

I have SSH-keys to the host. I am trying to use curl similarly as scp.

How can you use curl to download private data fast?

+1  A: 

I would suggest reading the man page of cURL for some info about how to do this. I don't think that cURL can replace scp in the way you want it to.

If you have a secure FTP (SFTP) server or secure HTTP SSL (HTTPS) server, then cURL can accept SSH keys (although using an SSL key is more commonly accepted on the Internet.) It can use those keys to authenticate and establish a secure connection to the directories which have been made public to your user through the server.

To see how to pass SSH keys, see --pubkey, --key, and --pass in the man page.

It's important to understand that your home directory doesn't have to be available through such a server. Even if you authenticate with a user and a password. scp works through a different server, and will (by default) interpret paths as if you were logged in. So that relative paths are relative to your home folder, just like you expect.

scraimer
Thank you for your explanation!
Masi
A: 

curl is an HTTP client - you cannot use it as a SSH client. What's wrong with SCP?

diciu
Thank you for your suggestion that you can use SCP the other way too!
Masi