LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   ftp connection closed before server asking for password (https://www.linuxquestions.org/questions/linux-server-73/ftp-connection-closed-before-server-asking-for-password-4175625499/)

catadetest 03-13-2018 10:47 AM

ftp connection closed before server asking for password
 
When trying to connect from machine1 (SUSE Linux) to example.com ftp server, I get "421 Service not available, remote server has closed connection." before the password input prompt. It never verified the password.

cata@machine1:~> ftp example.com
Connected to example.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Name (example.com:cata): username@example.com
421 Service not available, remote server has closed connection.

As you can see, it doesn't even verify the password.

But when I connect from machine2 (Ubuntu Linux), it works:

catalinubuntu@machine2:~> ftp example.com
Connected to example.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
Name (example.com:catalinubuntu): username@example.com
331 User username@example.com OK. Password required
Password:
As you can see, in this case, password prompt appears and I'm able to login. Is there any FTP client settings that I can adjust?

MensaWater 03-14-2018 08:48 AM

This suggests there is some firewall at example.com that is allowing machine2's IP but not allowing machine1's IP.

Do you own example.com? Can you examine its firewall setup (either its own iptables/firewalld or external device used as firewall in front of it)?

The TLS suggests you're using ftps vs regular ftp. Be sure you pay attention to both ports 20 and 21 (and/or 990 depending on whether this is implicit or explicit).

If you don't own example.com you may need to send a request to the owner to whitelist your outbound IP from machine1.

catadetest 03-20-2018 09:22 AM

No, example.com is someone else's server.
Turns out I can connect using the IP instead of the hostname.
Thanks

MensaWater 03-20-2018 09:55 AM

Quote:

Originally Posted by catadetest (Post 5833170)
Turns out I can connect using the IP instead of the hostname.Thanks

But you said machine1 can connect to example.com by name. This means you are resolving the IP from the name on machine1 but not on machine2. You might want to compare setup of the two. What is in /etc/resolv.conf? What is in /etc/hosts?


All times are GMT -5. The time now is 12:06 AM.