Home > Security > Change FTP Port

Change FTP Port

December 31, 2005 Posted by KP

After I changed the ssh port, combined with the changes of net.inet.tcp.blackhole and net.inet.udp.blackhole, now the server is completely free of ssh login attempts. I realized these two changes should be made together, it doesn’t make much sense to change only one of them. For example, if only change the port, the server will still respond to the port scan, it very probably gets more scan activity. What if only changed the system varibles? Since the ports of common services are the main target, the evil people still can easily find the ports to attack.

This reminded me of the ports of other common service, especially FTP. There are also lots of attempts for anonymouse FTP account, the message in /var/log/messages look like:
pure-ftpd: [ERROR] Unable to set up secure anonymous FTP

I’m using pure-ftpd (switched from proftpd), very easy installation and worked very well.

I used command line to start pure-ftpd. But to change the port, configuration file is necessary.
Copy or rename /usr/local/etc/pure-ftpd.conf.sample to /usr/local/etc/pure-ftpd.conf.

I changed “NoAnonymous no” to
“NoAnonymous yes”.

The default configuration for port:
# IP address/port to listen to (default=all IP and port 21).
# Bind 127.0.0.1, 21

It should be very easy to change this, but I coudn’t figure out the format for “all IP”, very silly :-(.

Start pure-ftpd with the configuration file:
# /usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf

Bookmark and Share


Related Posts:

Filed Under: Security

4 Comments to “Change FTP Port”

  1. Anonymous Says:

    Add the following line to pure-ftpd.conf to allow all IP and port 123:

    Bind ,123

  2. FreeBSD Newbie Says:

    Thanks for the info. It didn’t seem to work, although the grammar is correct, pure-ftpd always ingored the configuration and used port 21.

  3. Francois Says:

    I had similar frustrations and finally managed to get it working by using:

    Bind 0.0.0.0,123

  4. mm2004 Says:

    i have found that if you use this method then all will be well for all ip and port change the numbers to whatever you like for your port. :P ENJOY PPL

    Bind *,123

    put or change this in your pure-ftp config file :P HAVE FUN I DO :P

Leave a Comment









*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Categories

Archives

Links

Meta