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?
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?
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.