LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-05-2003, 03:18 PM   #1
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Rep: Reputation: 31
changing the port on vsftpd


How would I change the standard port 21 on vsftpd to one I select, i.e., port 5544?
 
Old 05-05-2003, 03:26 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Add:
listen_port 5544

to vsftpd.conf and that should do it.

You can get all the config options using:
man vsftpd.conf
 
Old 05-05-2003, 04:45 PM   #3
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Original Poster
Rep: Reputation: 31
Hi David,

I tried that yesterday and it didn't work. I entered the port into /etc/services as well and in my FW, but it still only works on port 21 and not the other.
 
Old 05-05-2003, 05:51 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
mmm - I've just ran some tests and it didn't work (to start with). When issuing a restart command to the service - the first time it stopped and started. From then on (I tried several times) it failed to stop but said it started.

I tried it on several ports including 110 (I don't have a pop server installed) and all failed.

I then rebooted into mandrake (same machine) to check something completely unrelated.

When I rebooted to RH9 I again changed the config file and issued a service restart command. This time it worked perfectly.

I have no idea why it failed the first time. It will now work on 5544, 110, 66 etc no problem.


All I can say is:
Try rebooting and change the config as the first thing you do. I'm not sure what could be causing this. If anyone has any idea I'd love to know - I'll do some digging myself if I have time.

Last edited by david_ross; 05-05-2003 at 05:54 PM.
 
Old 05-05-2003, 06:52 PM   #5
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Original Poster
Rep: Reputation: 31
no go for me I'm using RH9 and cloned the ftp setting in iptables with the port I wanted to use and added to /etc/services:

vsftpd 41202/tcp

still no luck...also rebooted to and tried both listen_port=41202 and listen_port 41202 (no = sign).
 
Old 05-05-2003, 07:03 PM   #6
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Original Poster
Rep: Reputation: 31
OK...got it working...I didn't have it in standalone mode and had to add the line "listen=YES". I guess I can't run it in xinetd and will have to put it somewhere in a startup rc...
 
Old 05-05-2003, 07:12 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Sorry - I should have said that. I don't run vsftpd from xinetd.

Have you had a look to see if there is a port option in your /etc/xinetd.d/vsftpd file?
 
Old 05-05-2003, 07:16 PM   #8
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Original Poster
Rep: Reputation: 31
yeah...tried it and it didn't work...I rely so much on xinetd and inetd that I forget how to start a file on bootup...can you tell me how you have yours start up?
 
Old 05-05-2003, 07:24 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
You should have /etc/init.d/vsftpd if not it is below.

Just run:
chkconfig 35 vsftpd on

Assuming you want it to start in runlevels 3 & 5. Remember to stop it running from xinetd as well.

Code:
#!/bin/bash
#
# vsftpd      This shell script takes care of starting and stopping
#             standalone vsftpd.
#
# chkconfig: - 60 50
# description: Vsftpd is a ftp daemon, which is the program \
#              that answers incoming ftp service requests.
# processname: vsftpd
# config: /etc/vsftpd/vsftpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -x /usr/sbin/vsftpd ] || exit 0

RETVAL=0
prog="vsftpd"

start() {
        # Start daemons.

        if [ -d /etc/vsftpd ] ; then
                declare -a sites
                sites=(`ls /etc/vsftpd/*.conf`)
                site_count=${#sites[@]}
                index=0

                while [ "${index}" -lt "${site_count}" ] ; do
                        site=`basename ${sites[${index}]} .conf`
                        echo -n $"Starting $prog for $site: "
                                ( /usr/sbin/vsftpd ${sites[${index}]} &)
                                daemon true
                                RETVAL=$?
                        echo
                        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
                        let "index = index + 1"
                done
        else
                RETVAL=1
        fi
        return $RETVAL
}

stop() {
        # Stop daemons.
        echo -n $"Shutting down $prog: "
        killproc $prog
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
        return $RETVAL
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        stop
        start
        RETVAL=$?
        ;;
  condrestart)
        if [ -f /var/lock/subsys/$prog ]; then
            stop
            start
            RETVAL=$?
        fi
        ;;
  status)
        status $prog
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
esac

exit $RETVAL
 
  


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
vsftpd on non-standard port baronsam Linux - Networking 3 08-21-2006 04:40 PM
vsFTPd - Changing folders and Port Connection Palula Linux - Software 0 09-12-2005 08:19 PM
Can vsftpd listen to another port? twelve Linux - Networking 9 05-05-2004 09:13 PM
vsftpd won't work with port 21 corpus_delicti Linux - Networking 5 10-14-2003 04:37 PM
Changing default directory / vsftpd chrisknight Linux - Software 5 03-27-2003 07:16 AM


All times are GMT -5. The time now is 06:56 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