My website has been hacked and i assume it was because they got hold of my FTP username and password.
would i be able to change the FTP port from 21 to another number.
Sat, 10/24/2009 - 19:59
Q. Because of security issues I would like to change vsftpd port 21. How do I configure vsftpd to use other ports instead of default TCP port 21.
A. vsftpd, which stands for Very Secure FTP Daemon, is an FTP server under Ubuntu, Fedora Core, Red Hat Enterprise Linux and a number of other distributions.
Changing default port is good idea.
All you need to do is edit the configuration file for vsftpd server. The default configuration file is /etc/vsftp/vsftpd.conf or /etc/vsftpd.conf.
First login as root user
Open vsftpd.conf file
# vi vsftpd.conf
Find line that read as follows
Replace port 21 with new port such as 201
Save and close the file. 201 is port number you can set it to whatever port you want. Please make sure no other service use 201 port.
Now restart vsftpd
# /etc/init.d/vsftpd restart
Client need to use port 21 while connecting to ftp server:
$ ftp ftp.myserver.com 201
Copyright © 2020, Easy Hosting Control Panel
Design by Zymphonies