LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2012, 08:53 AM   #1
sunveer
Member
 
Registered: Jul 2012
Posts: 139

Rep: Reputation: Disabled
Add port to FTP


How can I make ftp to listen on its default port 21 and another port 2121?
 
Old 08-08-2012, 09:40 AM   #2
kenneth_phough
Member
 
Registered: Dec 2005
Location: Birmingham, AL
Distribution: CentOS, REHL, Vine Linux
Posts: 67

Rep: Reputation: 3
You'll have to start antoher service that binds to the new port. I don't know what ftp server you are using but the general flow is like so:

1) Create another service
for example if I am using vsftpd then:
cp /etc/rc.d/init.d/vsftpd /etc/rc.d/init.d/vsftpd2121

2) modify /etc/rc.d/init.d/vsftpd2121 to point to a new config file.

3) copy and edit the new config file

for exmaple for vsftpd:

cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd2121.conf
edit the new config file so that ftpd bind to your new port.

4) start the new service
/etc/rc.d/init.d/vsftpd2121 start

and if you want it to start on boot
chkconfig vsftpd2121 on

Also if you are using iptables, don't forget to open the port.

HTH
Ken

Last edited by kenneth_phough; 08-08-2012 at 09:41 AM.
 
Old 08-08-2012, 09:47 AM   #3
sunveer
Member
 
Registered: Jul 2012
Posts: 139

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kenneth_phough View Post
You'll have to start antoher service that binds to the new port. I don't know what ftp server you are using but the general flow is like so:

1) Create another service
for example if I am using vsftpd then:
cp /etc/rc.d/init.d/vsftpd /etc/rc.d/init.d/vsftpd2121

2) modify /etc/rc.d/init.d/vsftpd2121 to point to a new config file.

3) copy and edit the new config file

for exmaple for vsftpd:

cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd2121.conf
edit the new config file so that ftpd bind to your new port.

4) start the new service
/etc/rc.d/init.d/vsftpd2121 start

and if you want it to start on boot
chkconfig vsftpd2121 on

Also if you are using iptables, don't forget to open the port.

HTH
Ken
What lines to edit in the new .conf file?
 
Old 08-08-2012, 09:57 AM   #4
kenneth_phough
Member
 
Registered: Dec 2005
Location: Birmingham, AL
Distribution: CentOS, REHL, Vine Linux
Posts: 67

Rep: Reputation: 3
depends on the ftp server. What are you using?

for vsftp it is

listen_port=21

change the port number to whatever you like.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add port 2086 sanchetanparmar Linux - Newbie 2 07-06-2011 11:29 AM
how to add ftp user. luqman Red Hat 1 02-24-2005 09:51 AM
SuSE 9.2 - FTP Port open with no FTP service?!?! don_wombat Linux - Security 12 12-01-2004 04:14 PM
Outside FTP Port 21 redirect to different port inside LAN??? hendrixx Linux - Security 5 06-05-2004 07:42 PM
ftp and ftp port forwarding with IPtables?? FunkFlex Linux - Security 3 04-24-2002 04:03 AM


All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration