Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2002 10:43:07 -0700
From:      Michael Collette <metrol@metrol.net>
To:        FreeBSD Mailing Lists <freebsd-questions@FreeBSD.org>
Subject:   FTP gone weird
Message-ID:  <200210091043.07131.metrol@metrol.net>

next in thread | raw e-mail | index | archive | help
Having a heck of a time with what I thought would be a pretty simple cron job 
of pulling down a web log via FTP.  In the process, I've run into a wall of 
port problems.

The Scenario:
I'm running an ssh session looped back to itself so as to configure a tunneled 
port forward from localhost:2121 to remoteserver:21

My cron job calls a small shell script that puts together the proper file name 
to get for the day, then issues the following command...

ftp ftp://${USER}:${PW}@${SITE}:${PT}${REMDIR}${FILE}

The site and port vars are set to "localhost:2121" to go through the tunnel.  
When I run this script from a command line, it works exactly as I would 
expect it to.  From cron, I get the following error...

Data connection to 127.0.0.1:49159 is not allowed when control connection is 
from 10.10.10.10:3553!

The from IP is faked for this example.  The actual error has the routeable IP 
address of this box.  The port numbers both increment on each attempt.

The end goal here is to just automate an FTP download through an SSH tunnel.  
The remote machine is not running sftp, nor do I have admin rights to it.  
SSH forwarding is pretty much my only option there.

Any ideas?

Later on,
-- 
"Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark 
to read."
 - Groucho Marx

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210091043.07131.metrol>