1. # nano -w /etc/xinetd.d/pureftp
2. change "service ftp" to "service pureftp"
save and close...
3. # nano -w /etc/services
4. search for
ftp 21/tcp
ftp 21/udp fsp fspd
and add this below it
pureftp 12345/tcp
pureftp 12345/udp fsp fspd
(you can change the number 12345 to any port number of your liking)
save and close...
5. # service xinetd restart
6. check your ports (# netstat -an | grep -i listen)
and look for the entry
tcp 0 0 0.0.0.0:12345 0.0.0.0:* LISTEN
if you see this, your ftp server no longer listens to port 21 but to port 12345 instead!
7. update your firewall to allow those ports if you used the [[ How+to+secure+your+Kloxo+with+IPTABLES|http://wiki.lxcenter. org/How+to+secure+your+Kloxo+with+IPTABLES]] tutorial!
change:
# FTP Out
iptables -t filter -A OUTPUT -p tcp --dport 20:21 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp --dport 30000:50000 -j ACCEPT
# FTP In
iptables -t filter -A INPUT -p tcp --dport 20:21 -j ACCEPT
iptables -t filter -A INPUT -p tcp --dport 30000:50000 -j ACCEPT
iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
echo - FTP : [OK]
to:
# FTP Out
iptables -t filter -A OUTPUT -p tcp --dport 12345 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp --dport 30000:50000 -j ACCEPT
# FTP In
iptables -t filter -A INPUT -p tcp --dport 12345 -j ACCEPT
iptables -t filter -A INPUT -p tcp --dport 30000:50000 -j ACCEPT
iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
echo - FTP : [OK]
8. # service firewall stop (because there is no restart command)
9. # service firewall start
10. check out http:// forum.lxcenter.org/index.php?t=msg&th=15938&goto=848 43&#msg_84843 if you want a more secure connection (TLS) also (thanks Semir!)
[Updated on: Wed, 22 June 2011 06:18]
Report message to a moderator