Koozali.org: home of the SME Server

ftp ports

derek

ftp ports
« on: April 08, 2002, 05:28:17 PM »
does anyone know how to change the default port for ftp in sme from the standard 21
thanks

Daniel Bahl

Re: ftp ports
« Reply #1 on: April 08, 2002, 07:04:08 PM »
Look in the template folder /etc/e-smith/templates/etc/proftpd.conf
Then change the file  "05port"  - and reset PROFTPD or the hole machine

There u goo

derek

Re: ftp ports
« Reply #2 on: April 09, 2002, 03:40:16 AM »
went to that file and changed to the port i wanted
still cant connect on that port
but i can connect on 21
any thoughts ?

Tom Carroll

Re: ftp ports
« Reply #3 on: April 11, 2002, 09:30:53 AM »
Derek, first of all, you should not modify the files in the /etc/e-smith/templates directory.  Always use the /etc/e-smith/templates-custom directory to do your modifications.  This ensures that if you have problems, all you have to do is delete the custom template and your configuration will be restored to the defaults.

To do it this way, you can type the following:

cp /etc/e-smith/templates/etc/proftpd.conf/05port /etc/e-smith/templates-custom/etc/proftpd.conf/05port

pico /etc/e-smith/templates-custom/etc/proftpd.conf/05port

Make your changes, then use CTL-O and CTL-W to save your changes and exit.

Expand the template by doing the following:

/sbin/e-smith/expand-template /etc/proftpd.conf

Restart the proftpd daemon or just reboot.

The template system is a great failsafe system that allows you to freely modify the SME configuration and play around without the risk of getting your system totally messed up that you have to do a complete reinstall to restore it to the original configuration.

Hope this helps!

Tom Carroll

derek

Re: ftp ports
« Reply #4 on: April 13, 2002, 04:28:55 AM »
Can you please assist on the port change I don’t know if what u posted really told me how to make the port change workTom Carroll wrote:

Tom Carroll

Re: ftp ports
« Reply #5 on: April 13, 2002, 07:22:25 AM »
Derek, I do not know if I can do any better on my directions.  All you need to do is follow the steps as mentioned, and change the port number in the 05port file from 21 to whatever port you want.  I do *not* recommend changing the port number to a port already in use by another service.

I will try to reitterate my instructions here:

[root@server root]# cp /etc/e-smith/templates/etc/proftpd.conf/05port /etc/e-smith/templates-custom/etc/proftpd.conf/05port

[root@server root]# pico /etc/e-smith/templates-custom/etc/proftpd.conf/05port

Change the port number from 21 to whatever port you are wanting to use, heeding the recommendation above.  (use CTL-O to save your changes and CTL-W to exit pico)

To create the new /etc/proftpd.conf file, expand the template by doing the following:

[root@server root]# /sbin/e-smith/expand-template /etc/proftpd.conf

I don't know what command you would use to restart the proftpd service, therefore you can just reboot the server for your changes to take effect.

Hope this helps Derek!

Tom Carroll

derek

Re: ftp ports
« Reply #6 on: April 13, 2002, 07:57:04 AM »
tryin it now going to reboot thanks
u seem to be fairly knowledgable in this
would you happen to know how to get write access to the admin in the primary dir so that i can add more folder to hold images and data for the main webpage ?

Tom Carroll

Re: ftp ports
« Reply #7 on: April 13, 2002, 08:13:50 AM »
As root, you have write access to *everything*.

Are you meaning that you do not have write access when uploading your web pages to your server?

I think this is covered in the users manual.  Check there, and if you can't find it, do a search on this site for "upload web" to see if you find anything.  If you don't, let me know and I will see if I can help you, but be sure to start another thread because someone else may need the help too.  Besides somone else more knowledgable may jump in to help you in stead of me. :)

Tom Carroll

derek

Re: ftp ports
« Reply #8 on: April 13, 2002, 08:20:25 AM »
wow fast response
oke i did the instructions u said for the ftp ports and cannot connect
i set port to 2121 and then tried 6667
but it does connect still on port 21
this is drivin me crazy

Tom Carroll

Re: ftp ports
« Reply #9 on: April 13, 2002, 08:39:39 AM »
Try looking at your /etc/proftod.conf file and scroll down until you find the port entry and ensure it is set to 2121.  If it is not, then your expand-template function wasn't run, or it didn't work.  You can change the port number in the file directly, then reboot - but be aware should you do a console-save or re-expand the template system your change will be lost, causing you to have to re-edit the proftpd.conf file.

Tom Carroll

Terry Brummell

Re: ftp ports
« Reply #10 on: April 13, 2002, 03:28:20 PM »
I mentioned this in the same thread that is running in the General Forum.  It shows as changed in the proftpd.conf file, but does not allow connections to the changed port.  It still connects on port 21.  I'm hoping someone from the NSSG may see this and give us some feedback.

Terry

derek

Re: ftp ports
« Reply #11 on: April 13, 2002, 05:50:33 PM »
as terry made comment to the changes are visible if you look at the proftpd.conf file and the port change is there
but still only connects on p21
any suggestions on this problem would be appreciated
thanks

Derek

Tom Carroll

Re: ftp ports
« Reply #12 on: April 13, 2002, 11:17:37 PM »
If the configuration file relects the new port and you have selected public access to your ftp server and upon reboot it does not respond to the configured port, I suggest sending a detailed message to bugs@e-smith.org.

If this is not a bug, there may be something hard coded somewhere that is overriding the configuration file settings.

At this point I have tried everything that I know of.

I do have one question - by changing your FTP port does it increase the security since the port number would have to be known?  Just curious why the port number would need to be changed from the standard ftp port.

Sorry I couldn't be of more help.

Tom Carroll

Tom Carroll

Re: ftp ports
« Reply #13 on: April 13, 2002, 11:19:09 PM »
Please see my response to Terry.

Tom Carroll

Damien Curtain

Re: ftp ports
« Reply #14 on: April 14, 2002, 06:30:22 AM »
Tom Carroll wrote:
>
> If the configuration file relects the new port and you have
> selected public access to your ftp server and upon reboot it
> does not respond to the configured port, I suggest sending a
> detailed message to bugs@e-smith.org.
>
> If this is not a bug, there may be something hard coded
> somewhere that is overriding the configuration file settings.

Its not a bug....

ftpd is run out of xinetd on e-smith, so changing proftpd's config file will have no effect. This is a quick walkthrough of what I think are the total sum of changes required, try yourself and decide if it works, it worked for me...

Make a file /etc/e-smith/templates-custom/etc/xinetd.conf/30ftp

ie. mkdir -p /etc/e-smith/templates-custom/etc/xinetd.conf/
cp /etc/e-smith/templates/etc/xinetd.conf/30ftp \
    /etc/e-smith/templates-custom/etc/xinetd.conf/30ftp

and make the following changes (service -> unlisted, add port, add protocol, add type)

{
    my $status = db_get_prop($confref, "ftp", "status") || "disabled";
    unless ($status eq "enabled")
    {
        $OUT .= "\n";
        $OUT .= "# proftpd is not enabled in the e-smith services database.";
        return;
    }
    my $accessLimits = db_get_prop($confref, "ftp", "accessLimits") || "private"
;
    if ($accessLimits eq "off")
    {
        $OUT .= "\n";
        $OUT .= "# ftp access limits has been set to 'disabled entirely'\n";
        $OUT .= "# in the e-smith services database.\n";
        return;
    }

    $OUT .= "service proftpd\n";
    $OUT .= "{\n";
    $OUT .= "    protocol               = tcp\n";
    $OUT .= "    port                    = \n";
    $OUT .= "    socket_type        = stream\n";
    $OUT .= "    wait                    = no\n";
    $OUT .= "    user                   = root\n";
    $OUT .= "    server                 = /usr/sbin/in.proftpd\n";
    $OUT .= "}";
}

ie. replace that with your desired port... (make sure its not something used by another running service /etc/services)

then expand your xinetd.conf file
/sbin/e-smith/expand-template /etc/xinetd.conf

and you should have a section like
service proftpd
{
    protocol                  = tcp
    port                        = 2121
    socket_type            = stream
    wait                        = no
    user                        = root
    server                      = /usr/sbin/in.proftpd
}

where ftp used to be...
--
 Damien