"curl" connection to ftp impossible : "500 ?" - linux

I am trying to connect to my NAS FTP server from a raspberry pi using the command "curl". The connection use ssl encryption, so I am using the following command type:
curl --ftp-ssl <FTPSERVEUR>:21 --user "<USER>:<PASS>"
Unfortunately, I get :
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 10 allowed.
220-Local time is now 20:38. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 10 minutes of inactivity.
530 You aren't logged in
500 ?
500 ?
500 ?
500 ?
500 ?
And then nothing appends.
It seems that curl is even not able to transmit my ID to the server.. Do you have any idea of what is going on ?
Thank you in advance for your help.

You need to use the URL syntax, i.e. ftp://host.... Otherwise curl does not know which protocol to use and will assume the default, i.e http://.... What you see in the output is actually the result of sending a HTTP request to the FTP server on port 21: First you get the response of the FTP server to the TCP connect (welcome message) which is then followed by several error messages as the result of trying to interpret the lines in the HTTP request as FTP commands.

Related

Node.js / curl(7) failed to connect to localhost port 3000. How to fix it?

response from testing
code hello.js
i am trying to create a web service with node.js. Unfortunately after implementing the application hello.js i am only able to test successfully "node hello.js", but furthermore when i type in "curl http://localhost:3000" i am getting "curl: (7) Failed to connect to localhost port 3000: connection estavlishment rejected"
This also happens with other ports oder when i type 127.0.0.1 directly. I also disabled my firewall with ufw and allow 3000 with ufw.
I am working with VirtualBox for a uni project. I am running everything in the VM. The goal is to cluster with docker and i need the web server for loadbalancing in the end.
Thanks!
The issue here that you use same terminal for multiple processes. As soon as you start the server, it holds the terminal. It means when you press Ctrl + C (^c in terminal output), you stop the server.
In your case you should use two terminals. In the first one you start the server (and do nothing with this particular terminal), in second one you make the request. Or you can change second step and make request from browser (it will be GET request by default), Postman, Insomnia etc.

How to proxy over ssh?

I have vps server where I have access to api.telegram.org, but on my local machine I could not get it.
I'm developing long poll bot for telegram, and now I need my bot to work locally - I think I can obtain it using ssh port forwarding but I dont know how to do it - I need to be able to use api.telegram.org throw my local machine over ssh to my vps
This might help
ssh -o "ServerAliveInterval 100" -L vps_server_ip:5000:api.telegram.org:80 some_vps_server_user#vps_server
This will redirect the request coming on port 5000 of vps_server to api.telegram.org at Port 80 .
Your bot has to connect to vps_server:5000 to access api.telegram.org

How to set a Loopback nodeJS backend on Apache HTTP server running on CentOS

I've moved the backend (nodeJs+Loopback) of my application on a server CentOS. When I run it, it's listening on "localhost:3000". If I type "curl http://localhost:3000" while I'm on the server's terminal I get a response. When I try to call the application from remote, I use the real IP address instead of localhost, but it doesn't work.
The error is:
[proxy:error] (13)Permission denied:HTTP: attempt to connect to 127.0.0.1:3000(localhost) failed
Do I need to setup some configuration?
Thank you
Have you tried # setsebool -P httpd_can_network_connect 1 ??
Check out the bottom of this link:
https://wiki.apache.org/httpd/13PermissionDenied

I can only access NodeJS server locally

My server's hosted at DigitalOcean (it's a droplet) and basically, I cannot access my NodeJS app via Internet, only server-side. It's running on port 9000, I've allowed traffic to the port via ufw and iptables, no luck. When I run curl || wget while SSH-ed to the server, I get a normal response as if everything's in order. But when I try to access the server from an another machine, I just get timed out because the server returns nothing. I've heard DigitalOcean sometimes disable connections to all ports except ssh,www and ssl, but I think I've successfully 'opened' them. Any suggestions?
This is what I get when I run netstat -tulp | grep LISTEN
Turns out my dashboard was all messed up when it comes to ports, which I forgot to check, of course, so opening them directly on the server gave no results whatsoever.

Post xml request over telnet on aix

I am trying to post xml request using telnet on AIX machine. I am using following command
cat filename | telnet hostip hostport
Request is going to server and response is also coming back to machine but telnet is not receiving that response.
Same command is working fine with HP-UX machine and telnet is receiving response.
As soon as I hit enter I see connection closed message on AIX machine. while on HP-UX I can see response.
Thanks for any help

Resources