Subject: Re: Passive ftp

From: Nash Foster <[email-masked]>
Date: Fri, 10 May 1996 15:17:02 -0400 (EDT)

We're having a problem with passive mode ftp. Clients trying to connect 
in passive mode get the following error:

#DB# rsp: 425 Trying, but can't open passive connection: Permission denied.

Does anyone out there have any experience with this kind of thing? We 
don't have any firewalls here so I've never had to deal with passive ftp 
modes and I'm feeling pretty clueless.

nash
sunsite.unc.edu

---------- Forwarded message ----------
[root@bittyblue /root]# ncftp -P
NcFTP 1.9.4 (April 15, 1995) by Mike Gleason, NCEMRSoft.
Tip: To report a bug, mail your message to [email-masked].  Include the
     output of the 'version' command in your message.  An easy way to do that
     is to compose your message, then do a 'ncftp -H >> msg.'
(Mail) ncftp>set debug 10
(Mail) ncftp>set logfile ftplog
#DB# "set logfile ftplog"
(Mail) ncftp>open sunsite.unc.edu
#DB# "open sunsite.unc.edu"
#DB# Host = 'sunsite.unc.edu'
#DB# rsp: 220 helios FTP server (Version wu-2.4(39) Tue May 16 01:34:21 
EDT 1995) ready.
#DB# cmd: "USER anonymous" (length 14)
#DB# rsp: 331 Guest login ok, send your complete e-mail address as password.
Guest login ok, send your complete e-mail address as password.
#DB# cmd: "PASS ********"
#DB# rsp: 230 Guest login ok, access restrictions apply.
Guest login ok, access restrictions apply.
#DB# cmd: "NOOP" (length 4)
#DB# rsp: 200 NOOP command successful.
200 NOOP command successful.
Logged into sunsite.unc.edu.
#DB# cmd: "PWD" (length 3)
#DB# rsp: 257 "/" is current directory.
257 "/" is current directory.
#DB# Current remote directory is "/"
#DB# cmd: "SYST" (length 4)
#DB# rsp: 215 UNIX Type: L8
#DB# cmd: "TYPE I" (length 6)
#DB# rsp: 200 Type set to I.
#DB# cmd: "PWD" (length 3)
#DB# rsp: 257 "/" is current directory.
257 "/" is current directory.
#DB# Current remote directory is "/"
sunsite.unc.edu:/
(Mail) ncftp>pwd
#DB# "pwd"
#DB# cmd: "PWD" (length 3)
#DB# rsp: 257 "/" is current directory.
257 "/" is current directory.
sunsite.unc.edu:/
(Mail) ncftp>ls
#DB# "ls"
#DB# ---> cmd: NLST;  rmt: -FC;  loc: -;  mode: w.
#DB# cmd: "PASV" (length 4)
#DB# rsp: 425 Trying, but can't open passive connection: Permission denied.
Passive mode refused.
#DB# cmd: "PORT 152,2,22,93,6,146" (length 22)
#DB# rsp: 200 PORT command successful.
#DB# cmd: "TYPE A" (length 6)
#DB# rsp: 200 Type set to A.
#DB# cmd: "NLST -FC" (length 8)
#DB# rsp: 150 Opening ASCII mode data connection for /bin/ls.
EPW7/     bin/      dev/      etc/      pub/      unc/      uploads/  usr/
#DB# rsp: 226 Transfer complete.
#DB# outfile closed.
#DB# recvrequest result = 0.
#DB# cmd: "TYPE I" (length 6)
#DB# rsp: 200 Type set to I.
sunsite.unc.edu:/
(Mail) ncftp>ascii
#DB# "ascii"
#DB# cmd: "TYPE A" (length 6)
#DB# rsp: 200 Type set to A.
sunsite.unc.edu:/
(Mail) ncftp>ls
#DB# "ls"
#DB# ---> cmd: NLST;  rmt: -FC;  loc: -;  mode: w.
#DB# cmd: "PORT 152,2,22,93,6,147" (length 22)
#DB# rsp: 200 PORT command successful.
#DB# cmd: "NLST -FC" (length 8)
#DB# rsp: 150 Opening ASCII mode data connection for /bin/ls.
EPW7/     bin/      dev/      etc/      pub/      unc/      uploads/  usr/
#DB# rsp: 226 Transfer complete.
#DB# outfile closed.
#DB# recvrequest result = 0.
sunsite.unc.edu:/
(Mail) ncftp>get /pub/docs/iafa/draft.part.I
draft.part.I   draft.part.II  
#DB# "get /pub/docs/iafa/draft.part.I"
#DB# ---> cmd: RETR;  rmt: /pub/docs/iafa/draft.part.I;  loc: 
/pub/docs/iafa/draft.part.I;  mode: w.
#DB# cmd: "SIZE /pub/docs/iafa/draft.part.I" (length 32)
#DB# rsp: 213 23244
213 23244
#DB# cmd: "MDTM /pub/docs/iafa/draft.part.I" (length 32)
#DB# rsp: 213 19920816043754
213 19920816043754
#DB# Used SIZE: yes;  Used MDTM: yes
#DB# Size: 23244
#DB# Mdtm: Sun Aug 16 05:37:54 1992

#DB# cmd: "PORT 152,2,22,93,6,148" (length 22)
#DB# rsp: 200 PORT command successful.
#DB# cmd: "RETR /pub/docs/iafa/draft.part.I" (length 32)
#DB# rsp: 150 Opening ASCII mode data connection for 
/pub/docs/iafa/draft.part.I (22753 bytes).
Receiving file: /pub/docs/iafa/draft.part.I 
#DB# rsp: 226 Transfer complete.                        23244 bytes. ETA: 
--:--
#DB# outfile closed.
100%  0                                                 23244 bytes. 
ETA:  0:00
/pub/docs/iafa/draft.part.I: 23244 bytes received in 0.29 seconds, 77.62 K/s.
#DB# recvrequest result = 0.
sunsite.unc.edu:/
(Mail) ncftp>quit
#DB# "quit"
#DB# cmd: "QUIT" (length 4)
#DB# rsp: 221 Goodbye.
#DB# Attempting to write /root/.ncrecent...
#DB# /root/.ncrecent written successfully.

---

From: [email-masked] (Winfried Magerl)
Date: Sun, 12 May 1996 13:31:19 +0200 (MDT)

> modes and I'm feeling pretty clueless.

I see the same problem on a our server ftp.mch.sni.de. After some searching
the solution was very easy. To use PASV you need ~/dev/tcp in the change
root directory. As in the manual-page for ftpd mentioned i create it,
but forget to set the write permissons for all.
Maybe the same problem for you. The permission denied is the resulting
error-message, because ftpd wants to access ~/dev/tcp for writing without
permission.

hope this helps ....

regards

	winfried

-- 
Winfried Magerl - Internet Administration
Siemens Business Services, 81739 Munich, Germany
Internet-Mail: [email-masked]

---

From: Nash Foster <[email-masked]>
Date: Tue, 21 May 1996 13:02:04 -0400 (EDT)

Hrm. Don't think that this is the problem. Check it out:

helios:/ % cd ~ftp
helios:/public/ftp % cd dev
helios:/public/ftp/dev % ls -la
total 4
dr-xr-xr-x   2 root     other        512 Apr 10 11:19 .
drwxr-xr-x  10 root     other        512 Apr 10 10:16 ..
crw-rw-rw-   1 root     other     11, 42 Apr 10 11:18 tcp
crw-r--r--   1 root     other    105,  1 Apr 10 11:19 ticotsord
crw-r--r--   1 root     other     11, 41 Apr 10 11:19 udp
crw-r--r--   1 root     other     13, 12 Apr 10 11:19 zero

*shrugs* We've got someone working on it, but since I haven't heard from 
him in a while, I would guess that he's not getting anywhere. Alas.

ciao,
	
	nash