RE: FTP: connection refused
George Gallen <[email protected]> Fri, 14 Nov 2003 11:35:41 -0500
| Newsgroups | gmane.linux.redhat.release.enigma |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C3AACD.57D6E1E6
Content-Type: text/plain;
charset="iso-8859-1"
in my /etc/xinet.d, it's setup as wu-ftpd
and looks like:
# default: on
# description: The wu-ftpd FTP server serves FTP connections. It uses \
# normal, unencrypted usernames and passwords for authentication.
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.ftpd
server_args = -l -a
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
}
>-----Original Message-----
>From: Keith Mastin [mailto:[email protected]]
>Sent: Friday, November 14, 2003 11:05 AM
>To: [email protected]
>Subject: Re: FTP: connection refused
>
>
>
>> Hi all, I have a tough problem that hopefully has a not so tough
>> solution. I'm trying to setup a simple ftp server on Red
>Hat 7.2 and I
>> can't get beyond "connection" refused when trying to connect
>externally.
>> I've read every FAQ and online guide I can and I can't
>figure out why.
>>
>> The big clue I think is that netstat -a says that ftp is not being
>> listened on. /etc/services looks ok to me (ftp is on port
>21 for both
>> UDP and TCP), I added the ftp service in /etc/xinet.d/ftp
>and restarted
>> xinetd, so I'm not sure what could be inhibiting ftpd.
>Here's my config
>> from /etc/xinet.d/ftp:
>
>Why do you need udp?
>
>> service ftp {
>> disable = no
>> socket_type = stream
>> wait = no
>> nice = 10
>> user = root
>> server = /usr/sbin/in.ftpd
>> server_args = -l
>> instances = 4
>> log_on_sucess += DURATION HOST USERID
>> }
>>
>> I modified /etc/hosts.allow and /etc/hosts.deny too. I wasn't sure
>> about hosts.allow so I copied the working nfs stuff to a new line and
>> changed it:
>> in.ftpd: 10.0.0.0/255.255.255.224
>> which is just like the entries for mountd, statd, etc.
>>
>> Not sure what else to say. Here's the long story summarized:
>> 1. Dowloaded wu-ftp and built it with ./configure and make
>
>Try vsftpd (very secure ftp)... less likely to get hacked or fubar'ed,
>comes in an rpm (you're running a redhat machine, right?) and it's a
>breeze to set up. Installing from sources on a redhat machine can be a
>turkey shoot as redhat regularily decides that files belong
>where redhat
>thinks they should go, not where the standards dictate. This
>in #2 on my
>personal list of beefs with redhat.
>
>If you insist on using wu-ftpd, then at least rebuild it from
>the source rpm.
>
>> 2. Created /usr/ftp and the little jail for it to run in.
>> 3. Check the firewall to make sure it didn't reject ftp.
>
>Which port, 20 or 21? Try opening both 20 and 21.
>
>> 4. Made changed to /etc/xinetd.d/ftp above and hosts files.
>> 5. Restarted xinetd
>> There maybe a few other things I did, this is what I recall for now.
>
>Go to .bash_history to check your work. You can also log all shell
>activity to a different file, but /bash_history should be
>sufficient for
>most cases.
>
>> I did a tcpdump trace of the connect attempt, the packets
>are reaching
>> the server and it replies, but the replies are all R
>(resets). I think
>> this is related to the fact that xinetd doesn't think it has
>something
>> to run on port 21 (ftp port).
>
>Can you connect in with telnet localhost 21?
>Does netstat -tuan show port 21 listening?
>
>--
>Keith Mastin
>BeechTree Information Technology Services Inc.
>Toronto, Canada
>(416)429 9304
>
>
>_______________________________________________
>enigma-list mailing list
>[email protected]
>https://www.redhat.com/mailman/listinfo/enigma-list
>
------_=_NextPart_001_01C3AACD.57D6E1E6
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2655.35">
<TITLE>RE: FTP: connection refused</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>in my /etc/xinet.d, it's setup as wu-ftpd</FONT>
</P>
<P><FONT SIZE=3D2>and looks like:</FONT>
</P>
<P><FONT SIZE=3D2># default: on</FONT>
<BR><FONT SIZE=3D2># description: The wu-ftpd FTP server serves FTP =
connections. It uses \</FONT>
<BR><FONT SIZE=3D2># normal, =
unencrypted usernames and passwords for authentication.</FONT>
<BR><FONT SIZE=3D2>service ftp</FONT>
<BR><FONT SIZE=3D2>{</FONT>
<BR><FONT SIZE=3D2> disable =
=3D no</FONT>
<BR><FONT SIZE=3D2> =
socket_type &=
nbsp; =3D stream</FONT>
<BR><FONT SIZE=3D2> =
wait &n=
bsp; =3D no</FONT>
<BR><FONT SIZE=3D2> =
user &n=
bsp; =3D root</FONT>
<BR><FONT SIZE=3D2> =
server =
=3D /usr/sbin/in.ftpd</FONT>
<BR><FONT SIZE=3D2> =
server_args &=
nbsp; =3D -l -a</FONT>
<BR><FONT SIZE=3D2> =
log_on_success =
+=3D DURATION USERID</FONT>
<BR><FONT SIZE=3D2> =
log_on_failure =
+=3D USERID</FONT>
<BR><FONT SIZE=3D2> =
nice &n=
bsp; =3D 10</FONT>
<BR><FONT SIZE=3D2>}</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>>From: Keith Mastin [<A =
HREF=3D"mailto:[email protected]">mailto:[email protected]</A>]</F=
ONT>
<BR><FONT SIZE=3D2>>Sent: Friday, November 14, 2003 11:05 AM</FONT>
<BR><FONT SIZE=3D2>>To: [email protected]</FONT>
<BR><FONT SIZE=3D2>>Subject: Re: FTP: connection refused</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>> Hi all, I have a tough problem that =
hopefully has a not so tough</FONT>
<BR><FONT SIZE=3D2>>> solution. I'm trying to setup a =
simple ftp server on Red </FONT>
<BR><FONT SIZE=3D2>>Hat 7.2 and I</FONT>
<BR><FONT SIZE=3D2>>> can't get beyond "connection" =
refused when trying to connect </FONT>
<BR><FONT SIZE=3D2>>externally.</FONT>
<BR><FONT SIZE=3D2>>> I've read every FAQ and online guide =
I can and I can't </FONT>
<BR><FONT SIZE=3D2>>figure out why.</FONT>
<BR><FONT SIZE=3D2>>></FONT>
<BR><FONT SIZE=3D2>>> The big clue I think is that netstat -a =
says that ftp is not being</FONT>
<BR><FONT SIZE=3D2>>> listened on. /etc/services looks ok =
to me (ftp is on port </FONT>
<BR><FONT SIZE=3D2>>21 for both</FONT>
<BR><FONT SIZE=3D2>>> UDP and TCP), I added the ftp service in =
/etc/xinet.d/ftp </FONT>
<BR><FONT SIZE=3D2>>and restarted</FONT>
<BR><FONT SIZE=3D2>>> xinetd, so I'm not sure what could be =
inhibiting ftpd. </FONT>
<BR><FONT SIZE=3D2>>Here's my config</FONT>
<BR><FONT SIZE=3D2>>> from /etc/xinet.d/ftp:</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>Why do you need udp?</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>> service ftp {</FONT>
<BR><FONT SIZE=3D2>>> disable =3D no</FONT>
<BR><FONT SIZE=3D2>>> socket_type =3D stream</FONT>
<BR><FONT SIZE=3D2>>> wait =3D no</FONT>
<BR><FONT SIZE=3D2>>> nice =3D 10</FONT>
<BR><FONT SIZE=3D2>>> user =3D root</FONT>
<BR><FONT SIZE=3D2>>> server =3D /usr/sbin/in.ftpd</FONT>
<BR><FONT SIZE=3D2>>> server_args =3D -l</FONT>
<BR><FONT SIZE=3D2>>> instances =3D 4</FONT>
<BR><FONT SIZE=3D2>>> log_on_sucess +=3D DURATION HOST =
USERID</FONT>
<BR><FONT SIZE=3D2>>> }</FONT>
<BR><FONT SIZE=3D2>>></FONT>
<BR><FONT SIZE=3D2>>> I modified /etc/hosts.allow and =
/etc/hosts.deny too. I wasn't sure</FONT>
<BR><FONT SIZE=3D2>>> about hosts.allow so I copied the working =
nfs stuff to a new line and</FONT>
<BR><FONT SIZE=3D2>>> changed it:</FONT>
<BR><FONT SIZE=3D2>>> in.ftpd: 10.0.0.0/255.255.255.224</FONT>
<BR><FONT SIZE=3D2>>> which is just like the entries for mountd, =
statd, etc.</FONT>
<BR><FONT SIZE=3D2>>></FONT>
<BR><FONT SIZE=3D2>>> Not sure what else to say. Here's the =
long story summarized:</FONT>
<BR><FONT SIZE=3D2>>> 1. Dowloaded wu-ftp and built it with =
./configure and make</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>Try vsftpd (very secure ftp)... less likely to =
get hacked or fubar'ed,</FONT>
<BR><FONT SIZE=3D2>>comes in an rpm (you're running a redhat =
machine, right?) and it's a</FONT>
<BR><FONT SIZE=3D2>>breeze to set up. Installing from sources on a =
redhat machine can be a</FONT>
<BR><FONT SIZE=3D2>>turkey shoot as redhat regularily decides that =
files belong </FONT>
<BR><FONT SIZE=3D2>>where redhat</FONT>
<BR><FONT SIZE=3D2>>thinks they should go, not where the standards =
dictate. This </FONT>
<BR><FONT SIZE=3D2>>in #2 on my</FONT>
<BR><FONT SIZE=3D2>>personal list of beefs with redhat.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>If you insist on using wu-ftpd, then at least =
rebuild it from </FONT>
<BR><FONT SIZE=3D2>>the source rpm.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>> 2. Created /usr/ftp and the little jail for =
it to run in.</FONT>
<BR><FONT SIZE=3D2>>> 3. Check the firewall to make sure it =
didn't reject ftp.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>Which port, 20 or 21? Try opening both 20 and =
21.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>> 4. Made changed to /etc/xinetd.d/ftp above =
and hosts files.</FONT>
<BR><FONT SIZE=3D2>>> 5. Restarted xinetd</FONT>
<BR><FONT SIZE=3D2>>> There maybe a few other things I did, this =
is what I recall for now.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>Go to .bash_history to check your work. You can =
also log all shell</FONT>
<BR><FONT SIZE=3D2>>activity to a different file, but /bash_history =
should be </FONT>
<BR><FONT SIZE=3D2>>sufficient for</FONT>
<BR><FONT SIZE=3D2>>most cases.</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>> I did a tcpdump trace of the connect =
attempt, the packets </FONT>
<BR><FONT SIZE=3D2>>are reaching</FONT>
<BR><FONT SIZE=3D2>>> the server and it replies, but the replies =
are all R </FONT>
<BR><FONT SIZE=3D2>>(resets). I think</FONT>
<BR><FONT SIZE=3D2>>> this is related to the fact that xinetd =
doesn't think it has </FONT>
<BR><FONT SIZE=3D2>>something</FONT>
<BR><FONT SIZE=3D2>>> to run on port 21 (ftp port).</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>Can you connect in with telnet localhost =
21?</FONT>
<BR><FONT SIZE=3D2>>Does netstat -tuan show port 21 =
listening?</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>>-- </FONT>
<BR><FONT SIZE=3D2>>Keith Mastin</FONT>
<BR><FONT SIZE=3D2>>BeechTree Information Technology Services =
Inc.</FONT>
<BR><FONT SIZE=3D2>>Toronto, Canada</FONT>
<BR><FONT SIZE=3D2>>(416)429 9304</FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT SIZE=3D2>></FONT>
<BR><FONT =
SIZE=3D2>>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>>enigma-list mailing list</FONT>
<BR><FONT SIZE=3D2>>[email protected]</FONT>
<BR><FONT SIZE=3D2>><A =
HREF=3D"https://www.redhat.com/mailman/listinfo/enigma-list" =
TARGET=3D"_blank">https://www.redhat.com/mailman/listinfo/enigma-list</A=
></FONT>
<BR><FONT SIZE=3D2>></FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C3AACD.57D6E1E6--