Thursday, August 29, 2013

Microsoft FTP Service and set ftp:fix-pasv-address no

Strange. I just did an FTP login to an FTP server which calls itself Microsoft FTP Service in the greeting message. After getting the greeting message, I tried several times but was unable to do a simple ls command after having given lftp the URL, the username, and the password.

Next, I used set ftp:fix-pasv-address no to set an lftp variable. It started working.

The reason why I tried set ftp:fix-pasv-address no is because lftp in debug mode was reporting it had found multiple valid ports. I'm not sure, but I seem to recall that each port had a unique IP address as well.

Since I was getting multiple valid ports back for passive mode, I assumed at that point that this was a NAT (network address translation) problem.

Therefore, I tried set ftp:fix-pasv-address no under the assumption that the multiple valid ports were really lftp trying to fix NAT problems.

After deciding that I was going to have to use set ftp:fix-pasv-address no from now on, I tried lftp without set ftp:fix-pasv-address no to see if I could go back and document the problem. The problem has disappeared! I seem to be able to log into this particular FTP server without using the set ftp:fix-pasv-address no command.

So now I have no idea what is going on. Oh well.

Ed Abbott

Tuesday, August 6, 2013

The ls Command Loops Endlessly on Filezilla Server

I'm using Filezilla Server for the first time. I've been aware of the Filezilla client for years. I had no idea that there was a Filezilla server.

When I would log into Filezilla Server using lftp, it would reconnect endlessly (after waiting 30 seconds each time) whenever I typed the ls command. If you can't do a simple ls command, what can you do?

This very simple command at the lftp command line seems to have solved my problem:

set ftp:passive-mode off

I've not yet tested this command very extensively. However it does seem to get me beyond the problem of an ls command that loops endlessly. In a sense, the ls command was hanging.

I'll test turning passive mode off more extensively later to see whether or not this is a comprehensive solution

Here's a web page that describes active mode as older and stinkier:

LFTP Cheatsheet

Stinkier or not, active mode seems to do the trick in the case of Filezilla Server. I'm not sure why, though I suspect it may have something to do with firewalls.

However, the above webpage suggests that passive mode will go through the greatest array of firewalls without incident --- so maybe this is the exception to a general rule.

Perhaps, in this case, it is active mode that is penetrating the firewall. Just a guess on my part. I don't really know enough to know for sure.

Update: August 19, 2013

The following command seems to log me into Filezilla Server just fine:

lftp -u username,password yourftpserver.com -e "set ftp:passive-mode off"

So far, I've been able to use all the lftp commands after logging in with the above command line. This includes the ls command and the command I care about the most, the mirror -c command. Love the mirror command!

I assume that the problem with passive mode has something to do with firewalls, network address translation, and IP addresses. However, all my attempts to resolve this issue while leaving passive mode in the "on" position have failed.

So, I've given up and am accessing Filezilla Server in active mode instead. If anyone has a better idea, please post below.

I've tried using the set -d | more command to discover possible switches I can flip that will make passive mode work. So far, no switch that I've flipped from its default position has worked.

By the way. set -d | more is a great discovery tool for discovering switches to flip. Once you've flipped a switch from its default position, you can always re-establish the default by flipping the switch with no argument. No argument to any one of the switches re-establishes the default.

For example:

set ftp:passive-mode off

will turn passive mode off.

set ftp:passive-mode

re-establishes the default.

set -d | grep passive

displays the default setting for passive mode on your screen and

set -a | grep passive

displays the current setting for passive mode on your screen.

Ed Abbott