Here are some hints which you may, (or may not), find useful from email's I
have sent in response to pleas of help since this was first released.

Mitch
-----------------------------------------------------------------------------

> Description: I set up anonymous ftp on my machine according
> to the man page that came with it (ftpd) and it works fine
> except the 'ls' or 'dir' command don't work.
> transfers in both directions work and it is attached to
> the proper directory. Once logged in, you can only change
> in the proper subdirectories and it finds the files that
> are there, except, it doesn't show them whit the dir(ls) command.
> 
> Here is what happens:
> ftp> ls (or dir)
> 200 PORT command successful
> 150 Opening ASCII mode data connection for /usr/bin/ls
> 
> then it hangs and nothing comes across and I have to abort it with ^C
> 
> 226 Transfer complete
> 225 ABOR command successful
> ftp>
> I set permissions for ls to all execute permission (111) and it is in /usr/bin
> What am I doing wrong?

You haven't put the binary in /usr/bin/ls in ftp's HOME DIRECTORY. This means
if user ftp's home directory is /home/ftp, then you MUST make a directory
/home/ftp/usr/bin and place the binary 'ls' in it ( and others too if you want
compression and tars of files/directories on the fly). You can make *hard*
links to the real versions if you want to.

Furthermore you MUST also put the shared DLL if the binaries are dynamically
linked. This means you must also put the file /lib/libc.so.4 in user FTP's
home directory (/home/ftp/lib in the above example) - again a *hard* link to
the actual libc.so.4.x.y will suffice. Also remember the dynamic linker
`ld.so' must also be in /home/ftp/lib (for those systems which support
dynamic linked executables - Linux, SunOS, FreeBSD )

Q: 	Do I need to edit ftpaccess?

Yes to allow/restrict number or certain sites from ftp'ing to your machine.
This file NEEDS to be edited for both real and anonymous users - but ONLY if
you are using my ftpd-diku (or any of the other souped-up ftpd's) and not
for the standard ftpd. You can tell if you are using my ftpd-diku as it will
come up with you machine name and kernel version on ftping to the machine..
like this

	220 linux FTP server (Linux linux 0.99.pl9-1 04/27/93 i486) ready.

If you are not using ftpd-diky then you will just get something like...

	220 linux FTP server (Version 5.60) ready.

Q:	Do I need to add 'anonymous' to ftpusers?

No 'anonymous' is a synonym for 'ftp' so you just need to add ftp if you want
to RESTRICT anonymous users coming into your machine.

Q: 	Are there man pages I should be looking at instead of bugging you?

The manpages README.mkgroup, README.linux, ftpd.8 and README.ftpaccess in
the ftpd-diku doc directory should hold everything you need to know. If
these are not in your distribution then get the latest ftpd-diku (with much
bug fixes) from

    sunsite.unc.edu in /pub/Linux/system/Network/file-transfer/ftpd-diku.taz


> I am working on the ftpd-diku release of the ftp modules.
> There seems to be a problem when I ftp locally and then
> try to do an 'ls' to see what's there.
> 
> The first case, my /etc/passwd file had user ftp's home
> directory at /home/ftp.  When it is configured in this manner
> I get the error message "Cannot open library 'libc-so-4'
> 
> I have symbolic links to libc-so-4.4.0

When an anonymous user log's into your machine his / (i.e. root directory)
becomes whatever the home field of the password file states.

This means that if the user `ftp's home directory in the password file is
	/home/ftp
then on login, he is chroot()'ed to this directory and then this becomes his
effective /. He/she will not be able to cd/READ (note the emphasis on read)
anywhere else on the disk. This further implies that NO symbolic links may be
made to files outside /home/ftp, (in this case), as readlink() will fail.

However you can save disk space by making HARD links to the shared libraries
and also the useful binaries in bin which reside outside this tree if and
only if you are also on the same partition as user `ftp's home . (ls, gzip,
uncompress, and tar)

Now if you are a SLS user you MUST also make a symbolic link in user ftp's
home directory from `usr' to `.' This is because SLS wants some stuff (like the
`ls' command)  to be in /usr/bin instead of /bin. (Either that or you can
splatter some binaries in /bin and some in /usr/bin)

So your use ftp's home directory should look something like 

% cd ~ftp; ls -laR
total 6
dr-xr-xr-x   6 root     wheel        1024 Dec 27 15:05 .
drwxr-xr-x   9 root     wheel        1024 Jan 26 15:32 ..
dr-xr-xr-x   2 root     wheel        1024 Mar 22 23:46 bin
dr-xr-xr-x   2 root     wheel        1024 Jan 13 01:32 etc
dr-xr-xr-x   2 root     wheel        1024 Mar  7 18:46 lib
dr-xr-xr-x   3 root     wheel        1024 Nov 23  1992 pub
lrwxrwxrwx   1 root     wheel           1 Jul 30  1993 usr -> .

bin:
total 131
dr-xr-xr-x   2 root     wheel        1024 Mar 22 23:46 .
dr-xr-xr-x   6 root     wheel        1024 Dec 27 15:05 ..
lrwxrwxrwx   1 root     wheel           4 Mar 22 23:46 compress -> gzip
lrwxrwxrwx   1 root     wheel           4 Mar 22 23:46 gnuzip -> gzip
---x--x--x   1 root     wheel       46084 Mar 22 23:45 gzip
---x--x--x   1 root     wheel       16836 Feb 17 19:12 ls
---x--x--x   1 root     wheel       70660 Mar 22 23:46 tar
lrwxrwxrwx   1 root     wheel           4 Mar 22 23:45 uncompress -> gzip

etc:
total 6
dr-xr-xr-x   2 root     wheel        1024 Jan 13 01:32 .
dr-xr-xr-x   6 root     wheel        1024 Dec 27 15:05 ..
-r--r--r--   1 root     wheel         199 Dec 27 15:42 group
-rw-r--r--   1 root     wheel         169 Aug 29  1992 mirrors.msg
-r--r--r--   1 root     wheel         109 Dec 27 15:38 passwd
-rw-r--r--   1 root     wheel         408 Jan 30  1993 welcome.msg

lib:
total 244
dr-xr-xr-x   2 root     wheel        1024 Mar  7 18:46 .
dr-xr-xr-x   6 root     wheel        1024 Dec 27 15:05 ..
-r-xr-xr-x   1 root     wheel       16388 Mar  7 18:47 ld.so
-rwxr-xr-x   1 root     wheel      619524 Mar  7 18:46 libc-lite.so.4.5.23
lrwxrwxrwx   1 root     wheel          19 Mar  7 18:46 libc.so.4 -> libc-lite.so.4.5.23

pub:
total 3
dr-xr-xr-x   3 root     wheel        1024 Nov 23  1992 .
dr-xr-xr-x   6 root     wheel        1024 Dec 27 15:05 ..
drwxr-xr--   2 root     wheel        1024 Apr 16  1993 private

pub/private:
total 2
drwxr-xr--   2 root     wheel        1024 Apr 16  1993 .
dr-xr-xr-x   3 root     wheel        1024 Nov 23  1992 ..

> 
> When I change the home dir to /home/ftp/pub then I no longer
> get the error message.  I don't get much more, either.
> What gives?

So when you say the above, it is because it is not finding either `ls' or the
shared library libc.so.4. Do NOT forget if you change the home directory to
/home/ftp/pub then you should also have at least the directories

1) /home/ftp/pub/bin
2) /home/ftp/pub/lib
3) /home/ftp/pub/etc (for the useless files passwd and group if you want the
	`ls' command to resolve gid's and uid's to names - Do NOT put a valid
	password file there with encrypted passwords or else I will come in,
	take them, run my password crack program on them and hack into your
	machine and delete all the files I find on it for a laugh :-) 

