Subject: ls doesn't show files, yes, it's statically linked, I read the FAQ

From: "Chris J. Magnuson" <[email-masked]>
Date: Sun, 26 Apr 1998 20:25:47 -0600

I am trying to get (chrooted) guest ftp to work right, and I've been trying
for awhile.  I have verified that it is properly doing chroot'ing by
creating some directories in the chroot spot and ftping in, then cd'ing
around in and out of them.

The problem is that ls doesn't show any files or directories.  Last time I
asked this question on the list I was told the answer was in the FAQ.  The
FAQ doesn't mention any other things to check for this problem besides:

1. doing chroot ~ftp /bin/ls to make sure it works and,
2. statically compiling ls.

If I do a chroot ~ftp /bin/ls  like the FAQ says to do to test that ls is
working, it produces a list of the files in the working directory.  So
according to that test, ls works.

When I do ldd ~ftp/bin/ls it tells me ls isn't dynamically linked, and if I
do ldd on the "normal" ls binary it tells me that some .so files are
involved, so the code I have is successfully linked statically.

This is a Linux Redhat 5 system, and the chrooting part works, I can verify
that by creating directories and doing cd into them, it's just that ls
won't show anything in there. It just comes back empty every time I type in
ls.

I've exhausted the documentation resources AFAIK, what other things should
I look at?

Thanks,
Chris

---

From: "Chris J. Magnuson" <[email-masked]>
Date: Sun, 26 Apr 1998 20:59:48 -0600

>I don't have any experience with Redhat Linux, but with Solaris
>you would need to have a passwd and group file in ~ftp/etc.
>
>Hope this helps,
>
>Kevin

Yep, I have those, group entry is:

users::100:

and passwd file says:

luser:*:100:100:Luser Name:/home/luser/./:/bin/ftponly

ftponly exists, is in /etc/shells, etc.

Chris

>Chris J. Magnuson wrote:

---

From: Michael Brennen <[email-masked]>
Date: Sun, 26 Apr 1998 22:02:30 -0500 (CDT)

Without detailed info it will be impossible to help you.  If you post
such, do so to the list.  Just a question: are you absolutely sure
that ~/bin/ls is directly under the /./ portion of your path in your
normal /etc/passwd path for that account?

   -- Michael

---

From: "Chris J. Magnuson" <[email-masked]>
Date: Sun, 26 Apr 1998 22:23:22 -0600

>normal /etc/passwd path for that account?

Doh!  I thought the files were supposed to go in the ~ftp/bin dir, you mean
they are supposed to be replicated in each /home/userdir tree for everyone
that has guest access?

Chris

---

From: Gregory A Lundberg <[email-masked]>
Date: Mon, 27 Apr 1998 05:57:13 -0400 (EDT)

> they are supposed to be replicated in each /home/userdir tree for everyone

Yep.

If your guest users are also real users (by that I mean you're chroot'ing
ftp access for real users) you can move the choot point to the first
common point.  All my users are in /home/users/<username> so I chroot to
/home/users/./<username> and save most copies of the files.  Actual guests
who do not have shell access, however, have their own local copies of the
files.

I'm also running RHL and the ability to create hard links seems to be
broken, so I can't hard link 'em.  Since it's not a problem (I only have a
couple actual guests) I'm not worried about the wasted space.  When (if)
it becomes a problem, I'll fix whatever it is that's broken in RHL and get
hardlinks working.

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              email: [email-masked] [205.133.13.8]
Kettering, OH 45409-1615 USA    voice: +1 (937) 299-7653

---

From: Michael Brennen <[email-masked]>
Date: Mon, 27 Apr 1998 07:30:39 -0500 (CDT)

As described in the guest howto, yes.  Hard links can solve most of
the space problems, and perl scripts can automate all the setup.

   -- Michael