无法在终端快速从我的服务器下载数据

时间:2021-10-12 20:04:29

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.

我有主机的SSH密钥。我试图像scp一样使用curl。

How can you use curl to download private data fast?

如何使用curl快速下载私人数据?

2 个解决方案

#1


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

curl是一个HTTP客户端 - 您不能将其用作SSH客户端。 SCP有什么问题?

#2


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.

我建议阅读cURL的手册页,了解有关如何执行此操作的一些信息。我认为cURL不能以你想要的方式替换scp。

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.

如果您有安全的FTP(SFTP)服务器或安全的HTTP SSL(HTTPS)服务器,则cURL可以接受SSH密钥(尽管在Internet上更常使用SSL密钥。)它可以使用这些密钥进行身份验证和建立与通过服务器公开给您的用户的目录的安全连接。

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

要了解如何传递SSH密钥,请参见手册页中的--pubkey, - key和--pass。

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.

重要的是要了解您的主目录不必通过这样的服务器可用。即使您使用用户和密码进行身份验证。 scp通过不同的服务器工作,并且(默认情况下)将解释路径,就像您已登录一样。因此相对路径相对于您的主文件夹,就像您期望的那样。

#1


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

curl是一个HTTP客户端 - 您不能将其用作SSH客户端。 SCP有什么问题?

#2


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.

我建议阅读cURL的手册页,了解有关如何执行此操作的一些信息。我认为cURL不能以你想要的方式替换scp。

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.

如果您有安全的FTP(SFTP)服务器或安全的HTTP SSL(HTTPS)服务器,则cURL可以接受SSH密钥(尽管在Internet上更常使用SSL密钥。)它可以使用这些密钥进行身份验证和建立与通过服务器公开给您的用户的目录的安全连接。

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

要了解如何传递SSH密钥,请参见手册页中的--pubkey, - key和--pass。

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.

重要的是要了解您的主目录不必通过这样的服务器可用。即使您使用用户和密码进行身份验证。 scp通过不同的服务器工作,并且(默认情况下)将解释路径,就像您已登录一样。因此相对路径相对于您的主文件夹,就像您期望的那样。