"The Linux Gazette...making Linux just a little more fun!"


(?) The Answer Guy (!)


By James T. Dennis, [email protected]
Starshine Technical Services, http://www.starshine.org/


(?) 'ls' Doesn't work for FTP Site

From Reuel Q. Salamatin on Tue, 01 Dec 1998

(?) Mr. James T. Dennis,

I am so happy to have known that you are available to anwer Linux questions. I have tried emailing persons I found from how-to files and documentations about ftp, but as of yet, got no answers.

Here's my problem. Our ftp site doesn't seem to support the ls command.

Usually, upon log-in, or with a browser it should display directory listings. Now it worked just like that before. But now, it doesn't. I don't actually remember how it came about to be like that.

I have followed instructions listed on the ftpd man page, about making a copy of the ls command on the bin directory of ftp home. I did just that but still no directory listing output. I was wondering what else could have gone wrong.

Thank you even now in anticipation of your response.

Sincerely yours,
Mr. Roland Reuel Q. Salamatin

(!) Assuming that you're using one of the traditional FTP servers (daemons) such as the BSD derived one, or WU-FTPD (which has been the default on most Linux distributions for several years), this probably relates to one of three problems. All have to do with the 'chroot' jail in which anonymous FTP (and the "guestgroups" from WU-FTP) operate.
The idea here is that we've tried to minimize the risks to your system that are associated with having untrusted parties (anonymous and guest FTP users) accessing your directories. So we set up a psuedo "root" directory and issue the 'chroot()' system call to "lock the process into a directory."
On problem with this approach is that most Unix/Linux programs need access to files like '/etc/passwd' and '/etc/group' (to map the numeric ownership codes that are stored in the inodes of file and directories to the associated names and groups. Also most modern programs (dynamically linked ELF binaries) require access to '/dev/zero' (a psuedo-device) for fairly obtuse reasons that amount to "because that's the way they work."
So we need to build a skeletal copy/shadow of the system's directory structure to support this. That must contain at least the following files:
(You can compile a statically linked 'ls' or you can use the 'ldd' command to get a list of the required shared libraries).
Another option is to replace the BSD or WU ftp daemon with Mike Gleason's 'ncftpd', or with ProFTPD which both have built-in static 'ls' support.
'ncftpd' is not free. It is shareware and can be registered for about $200 for a high volume server (more than 50 concurrent users) or ~$40 for a smaller server. Mike Gleason continues to support and release the best FTP client for free. There is also a free "personal use" option (upto 3 concurrent users). You can find out more:
http://www.ncftp.com
Of the FTP daemons that I've tried, 'ncftpd' was the easiest to set up and definitely the easiest to configure. It also supports "virtual FTP hosting" (where one host appears to be several different FTP servers, each with different directory structures and separate user lists). My only complaint was that this server doesn't seem to like being dynamically loaded from 'inetd' (unlike the normal ftp daemons --- but more like 'sendmail' and most web servers).
ProFTPD is under the GPL. I know know the author's name and it may be a whole team that's worked on it.
http://www.proftpd.org
I have yet to try this one. However it looks very ambitious --- and might appeal to Apache webmasters in particular. The configuration files and directives are intentionally set to match or resemble Apache configuration options wherever possible.
From what I've read the original author started working on a security audit and patch set to WU-FTPD and gave up. He then wrote the whole thing from scratch.
So, I hope that helps. Naturally you could just fuss with the existing ftp daemon and "get it to work." Alternatively either of these replacements might be much better for your needs --- and considerably easier, as well.
If not then there are a few other choices:
BeroFTPD:
ftp://ftp.aachen.linux.de/pub/BeroFTPD
This is a WU-FTPD derivative.
Troll Tech FTP Daemon:
http://www.troll.no/freebies/ftpd.html
Troll Tech is the publisher of the Qt libraries on which KDE is built.
anonftpd
ftp://koobera.math.uic.edu/www/anonftpd.html
by D.J Bernstein (author of qmail) --- very lightweight FTP daemon, purely for read-only anonymous access. (Doesn't support normal user or "guest" accounts). Main focus is on security and low memory footprint.
... and I'm sure we could find many others.


Copyright © 1999, James T. Dennis
Published in The Linux Gazette Issue 36 January 1999


[ Answer Guy Index ] a b c 1 2 3 4 5 6 7 9 10 11 12
15 16 18 19 20 21 22 23 24 25 26 27 28
29 31 32 33 34 35 36 37 38 39 40 41 42 44
45 46 47 48 49 50 51 52 53 54 55 56 57 60 61 62 63 64 65 66
67 69 72 76 77 78 79 80 81 82 84 85 86 87 91 94 95 96 97 98


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Next Section ]