Trouble Assigning Alternate FTP Port

urantian

Well-Known Member
Jan 26, 2005
97
1
158
Fayetteville, Arkansas
cPanel Access Level
Root Administrator
Greetings,

I am using Pure-FTPd and want to change the port from the default of 21. I modified the pure-ftpd.conf file, to change:

# Bind 127.0.0.1,21

to:

Bind 127.0.0.1,606 (or any other port)

However, when I attempt to restart the FTP server in cPanel, it fails. When I restore the line to its original state, the FTP server restarts as expected. Am I using the wrong syntax, or is there something else I must do?

Thank you,

---Michael
 

forum17

Active Member
Mar 30, 2007
29
0
151
Hello,

I just replaced the line Bind 127.0.0.1,21 to Bind *,1000 then opened the port 1000 in csf firewall and it worked.

Hope it helps.

Regards,
host.co.in.
 

urantian

Well-Known Member
Jan 26, 2005
97
1
158
Fayetteville, Arkansas
cPanel Access Level
Root Administrator
Thank you for the information. I used your example, and added "Bind *,1000" to "pure-ftpd.conf" and added port 1000 to the CSF firewall configuration here:

===============
# Allow incoming IPv6 TCP ports
TCP6_IN = ..................
===============

I am still getting the following error when restarting pure-ftpd:

===============
Waiting for ftpserver to restart...............finished.

pure-ftpd (pure-ftpd (SERVER)) running as root with PID 11606
pure-authd (/usr/sbin/pure-authd -s /var/run/ftpd.sock -r /usr/sbin/pureauth) running as root with PID 11609

ftpserver has failed, please contact the sysadmin.
===============

I wonder what I am doing wrong.

---Michael
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
You aren't also on IPv4 on the machine? In my CSF, port 21 is listed in all of the following:

# Allow incoming TCP ports

# Allow outgoing TCP ports

# Allow incoming UDP ports

# Allow outgoing UDP ports
You may wish to re-review the settings for CSF for where port 21 is already listed and place your new port in that list. Try shutting down CSF entirely (disabling it in WHM > Plugins > ConfigServer Security & Firewall area) to see if that is even the issue. If it still doesn't start with CSF disabled, then the firewall is not causing this to happen.
 

urantian

Well-Known Member
Jan 26, 2005
97
1
158
Fayetteville, Arkansas
cPanel Access Level
Root Administrator
It's not the firewall. I stopped and disabled it, and pure-ftpd will not start.

Perhaps I am not configuring properly. I am modifying "/etc/pure-ftpd.conf". This is what I have in it:

==============
# IP address/port to listen to (default=all IP and port 21).

# Bind 127.0.0.1,21

Bind *,1000
==============

So, even with csf out of the picture, this is not working. If I comment out "Bind *,1000", it starts successfully.

---Michael
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hi Michael,

My /etc/pure-ftpd.conf file works when changing the port to another one (it starts up and listens on the new port). There has to be another issue here on what is happening. Is there anything in /var/log/messages on the restart attempt that provides further logging details?

Thanks.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hi again Michael,

I noticed that chkservd that monitors FTP services actually believes FTP is down when the port is changed. Even if you change /etc/chkserv.d/ftpd file to have the alternate port instead, when you restart chkservd with /scripts/restartsrv_chkservd command, it changes the port back to 21. You are probably going to have to uncheck monitor for WHM > Service Manager for FTP to get this working. After you do uncheck that, try restarting it again and see the results. It is running for me on my alternate port, but chkservd kept restarting it because it was checking for port 21.

Thanks.
 

urantian

Well-Known Member
Jan 26, 2005
97
1
158
Fayetteville, Arkansas
cPanel Access Level
Root Administrator
Thank you very much for the assistance. I turned off FTPD monitoring in the Service Manager. According to "service pure-ftpd status", it is running. And, this is what is in the /var/log/messages file:

======
Feb 2 13:50:25 server pure-ftpd: pure-config.pl startup succeeded
Feb 2 13:51:25 server kernel: Firewall: *UDP_IN Blocked* IN=eth0
======

It appears to be running. However, is the firewall blocking all ports in?

---Michael
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
It might be if you haven't opened up the port in the UDP section of the firewall as I mentioned might need to be done. You could try connecting to FTP to see the results if it is working.
 

urantian

Well-Known Member
Jan 26, 2005
97
1
158
Fayetteville, Arkansas
cPanel Access Level
Root Administrator
I think I found the trouble. I'm working away from my normal location. Using an air card, I am able to establish an FTP connection into port 1000. However, I cannot connect via the network where I'm located. Apparently, FTP is being blocked on all ports.

Thank you very much for your help!

---Michael