You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Fred Moore <fr...@gmail.com> on 2009/01/15 15:28:42 UTC
Any war stories about having FTPServer listening on port 21 on a
Linux box?
Hi folks,
I'm looking for war stories and checklists about having FTPServer (and by
implication the JRE java process itself) listening on port 21 on a Linux
box.
Apparently there are several security issues to consider when listening on
"low" (<1024) ports, like SUID root previleges and the fact that
LD_LIBRARY_PATH is not used anymore.
Jetty (Java HTTP Server) guys for a similar port 80 issue provide a specific
setuid feauture but also suggest an apparently simple alternative approach
based on ipchains and iptables (
http://docs.codehaus.org/display/JETTY/port80).
Has anyone succeeded in running FTPServer on port 21? Any gotchas?
Cheers,
F.
Re: Any war stories about having FTPServer listening on port 21 on a
Linux box?
Posted by Fred Moore <fr...@gmail.com>.
> I've added a page to the Wiki here:
>
>
http://cwiki.apache.org/confluence/display/FTPSERVER/FtpServer+and+port+21+on+Linux
...well done NiklasG!
Any hints anyone on equivalent approaches for Solaris, AIX and HP-UX using
tools built-in the operating system?
Cheers,
F.
Re: Any war stories about having FTPServer listening on port 21 on a Linux box?
Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Mon, Jan 19, 2009 at 9:10 AM, Niklas Therning <ni...@trillian.se> wrote:
> I've added a page to the Wiki here:
>
> http://cwiki.apache.org/confluence/display/FTPSERVER/FtpServer+and+port+21+on+Linux
Thanks a lot!
/niklas
Re: Any war stories about having FTPServer listening on port 21 on
a Linux box?
Posted by Niklas Therning <ni...@trillian.se>.
Niklas Gustavsson wrote:
> On Fri, Jan 16, 2009 at 9:10 AM, Niklas Therning <ni...@trillian.se> wrote:
>
>> Fred Moore wrote:
>> This is what I do
>>
>> iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT
>> --to-ports 60021
>>
>> This simply fowards all traffic on port 21 to port 60021. No need for my
>> Java app to run as root or setuid or anything like that.
>>
>
> Would you be able to add this to our wiki, I think it would be
> valuable to a lot of users. I can also do it myself but I'm not much
> of an iptables expert :-)
>
> /niklas
>
I've added a page to the Wiki here:
http://cwiki.apache.org/confluence/display/FTPSERVER/FtpServer+and+port+21+on+Linux
I've also added a link to it to the Documentation page.
Please beware that I'm not much of an iptables expert either. So it
would be nice if you guys could have a look and tell me what you think.
--
Niklas Therning
www.spamdrain.net
Re: Any war stories about having FTPServer listening on port 21 on a Linux box?
Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Fri, Jan 16, 2009 at 9:10 AM, Niklas Therning <ni...@trillian.se> wrote:
> Fred Moore wrote:
> This is what I do
>
> iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT
> --to-ports 60021
>
> This simply fowards all traffic on port 21 to port 60021. No need for my
> Java app to run as root or setuid or anything like that.
Would you be able to add this to our wiki, I think it would be
valuable to a lot of users. I can also do it myself but I'm not much
of an iptables expert :-)
/niklas
Re: Any war stories about having FTPServer listening on port 21 on
a Linux box?
Posted by Niklas Therning <ni...@trillian.se>.
Fred Moore wrote:
> Hi folks,
>
> I'm looking for war stories and checklists about having FTPServer (and by
> implication the JRE java process itself) listening on port 21 on a Linux
> box.
>
> Apparently there are several security issues to consider when listening on
> "low" (<1024) ports, like SUID root previleges and the fact that
> LD_LIBRARY_PATH is not used anymore.
>
> Jetty (Java HTTP Server) guys for a similar port 80 issue provide a specific
> setuid feauture but also suggest an apparently simple alternative approach
> based on ipchains and iptables (
> http://docs.codehaus.org/display/JETTY/port80).
>
> Has anyone succeeded in running FTPServer on port 21? Any gotchas?
> Cheers,
> F.
>
>
This is what I do
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT
--to-ports 60021
This simply fowards all traffic on port 21 to port 60021. No need for my
Java app to run as root or setuid or anything like that.
--
Niklas Therning
www.spamdrain.net
Re: Any war stories about having FTPServer listening on port 21 on a Linux box?
Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Thu, Jan 15, 2009 at 3:28 PM, Fred Moore <fr...@gmail.com> wrote:
> Jetty (Java HTTP Server) guys for a similar port 80 issue provide a specific
> setuid feauture but also suggest an apparently simple alternative approach
> based on ipchains and iptables (
> http://docs.codehaus.org/display/JETTY/port80).
I don't have any experiences with this myself, but I'm hoping to look
into something similar as the Jetty guys provide, where one would
start the server as root and it would then give up the root access
using setuid.
/niklas