First thing you could try is connecting from your Virtualmin machine, SSH command line, to your FTP server. Do so via “ftp”, “telnet” and “netcat”, to test different things.
Okay, so the FTP server is working in general, that’s good. I took a look at the Virtualmin source code, and the error message you get doesn’t necessarily mean that the actual connection to the server failed.
Try the following: do ftp xx.xx.xx.xx and log on to the server with the same credentials as you entered in Virtualmin.
Then do the command PWD (in capitals). Do you get a message like 257 / is the current directory then, or ?Invalid command? What if you try pwd in lower case?
I’ve tested some more. And it seems only to be when I’m not doing a full backup with all features. Its only when I Choose some of the feature or servers, it fails.
It works fine on a full backup with all servers and all features?
Then this looks like a Virtualmin bug. VM is using the command “PWD” in capitals, triggering the error you see. The coders will need to fix this and change PWD commands to pwd.
As a quick fix, you can go to the file /usr/share/webmin/virtual-server/backup-libs.pl, line 279, and change the "PWD" there to "pwd". That should fix the issue, although there might be other instances of FTP commands in incorrect capitals.
I sent Eric an email referring to this thread, so he’ll make sure it gets fixed.
I was a bit suspicious about this upper-lower-case thing, and I checked out the RFC for FTP, and did a test on my system. Apparently, FTP commands are allowed to be both upper and lower case. On my server, both variants work:
220 ProFTPD 1.3.4a Server (Debian) [::ffff:*********]
USER *******
331 Password required for ********
PASS *******
230 User ****** logged in
PWD
257 "/" is the current directory
pwd
257 "/" is the current directory
So you see my system is using the same ProFTPD version as yours. I’m a bit surprised that “PWD” gives an error for you, while “pwd” doesn’t!
Connected to XXX.XXX.XXX.XXX.
220 ProFTPD 1.3.4a Server (Debian) [::ffff:...]
Name (XXX.XXX.XXX.XXX:*****): XXXXXX
331 Password required for XXXXXX
Password:
230 User XXXXXX logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 “/” is the current directory
ftp> PWD
?Invalid command
ftp>
Well as I said, according to the RFC, the FTP commands are case-insensitive. So both lower and upper case should work. For me, it does. And I have the same OS and ProFTPD version as you. I have no idea why yours gives an error for “PWD”.
By the way, is there actually a question mark before the “Invalid command” message for you? Because here, when I do type an invalid command in Windows’ text mode FTP client, I get NO question mark in the reply.
Can you please test this with telnet? Type telnet server.domain.tld and then follow the transcript as below. With USER and PASS to log in. It’s possible that it’s just your FTP client that has the problem with the Invalid command thing, and not the server.
220 ProFTPD 1.3.4a Server (Debian) [::ffff:xxx.xxx.xxx.xxx]
USER xxxxxxx
331 Password required for xxxxxx
PASS xxxxxxxxxx
230 User xxxxxx logged in
pwd
257 “/” is the current directory
PWD
257 “/” is the current directory
abc
500 ABC not understood
quit
221 Goodbye.
/etc/proftpd/proftpd.conf:# If set on you can experience a longer connection delay in many cases.
/etc/proftpd/proftpd.conf:# In some cases you have to specify passive ports range to by-pass
dpkg -l 'proftpd*' :
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
++±=======================-=======================-==============================================================
un proftpd (no description available)
un proftpd-abi-1.3.4a (no description available)
ii proftpd-basic 1.3.4a-1 Versatile, virtual-hosting FTP daemon - binaries
un proftpd-doc (no description available)
un proftpd-mod-ldap (no description available)
un proftpd-mod-mysql (no description available)
un proftpd-mod-odbc (no description available)
un proftpd-mod-pgsql (no description available)
un proftpd-mod-sqlite (no description available)
You’re seeing something pretty unusual, and unfortunately I’m not sure what might cause that… I haven’t seen that behavior elsewhere.
My best guess is that you’re seeing a configuration problem of some sort… though what that might be isn’t immediately clear.
One thing I do notice is that, if you’re using Debian 7, the package version you have there isn’t the most recent available to Debian.
You could always try renaming the /etc/proftpd directory to something else, perhaps /etc/proftpd.orig, and then updating ProFTPd to the latest version, which should re-create that directory, along with the config files in it.