0

I'm trying to post tar archive from one remote server to another, but while I execute the command

curl --user "root:$password" -X POST -T archive.tar ip-address

I get

curl: (7) Failed connect to ip-address:80; Connection refused

What should I change at ip-address server to open 80 either 8080 ports?

These ports are not in listen state while I execute netstat -atpn

  • Are 80 and 8080 ports should be listened by additional software I need install firstly? – palmasd1 Feb 13 '24 at 07:37
  • 1
    No. You need to install a web server like Apache2 to listen on 80 or 8080. Even with it installed, it won't accept file uploads or POST without additional software. You probably want to install a SSH server, then use scp on the client to upload the file – Daniel T Feb 13 '24 at 07:51
  • @DanielT scp worked. Thank you! – palmasd1 Feb 13 '24 at 09:13
  • @DanielT Yep. It looks like I have even already read it.. – palmasd1 Feb 13 '24 at 09:36
  • @DanielT Would my current question enabled by search engines either it would be removed? – palmasd1 Feb 13 '24 at 09:37
  • Duplicates (at least those that are not downvoted) are usually not removed because they serve a signposts (such as for search engines) towards the canonical question. I find it strange that you found something that told you to use a curl with POST to transfer files. Which website told you to do that? – Daniel T Feb 13 '24 at 09:43
  • @DanielT I don't remember. I just have always download the files from dumpfile to several different hosts, so now I was need to upload my files and found such way. – palmasd1 Feb 14 '24 at 04:25

1 Answers1

1

Alternate way to transfer files between the servers is scp file_path user@server_ip:path

Daniel T
  • 4,594