Subject: Re: Group Controls...

From: [email-masked] (Geoff Terry Systems & Net supt 064 923677)
Date: Wed, 11 Dec 1996 13:43:18 +1100 (EST)

Mauricio,
I think...............
you need to put copies of, or links to (use hard links back to the source to
save fs space);
ls in ~<chrooted>/bin (and any other commands you want users to be able to
executed eg gzip tar compress)
& the associated libraries in ~<chrooted>/usr/lib

Note. If /bin and /usr are on a different filesystem then I suggest local
copies to somewhere appropriate on the file system where the chrooted ftp
directory tree lives then hard links from each clients chrooted directory to
the copies.

try executing
truss -f chroot ~<chrooted> /bin/ls 2>&1 >/dev/null | grep open
this will show you all the libraries called by ls 
I have...................
-rwxr-xr-x   3 bin      bin       107532 Nov 21 14:10 ld.so.1
-rwxr-xr-x   4 bin      bin       664048 Oct 28  1995 libc.so.1
-rwxr-xr-x   3 bin      bin         2568 Nov 21 14:10 libdl.so.1
-rwxr-xr-x   4 bin      bin        15304 Oct 25  1995 libintl.so.1
-rwxr-xr-x   4 bin      bin        39340 Oct 25  1995 libw.so.1  
but not all are needed

you also need to;

cd ~<chrooted>/dev
mknod zero c x y
mknod tcp c a b

(check /dev/zero and /dev/tcp for the values of x y a b - they are platform
dependent) do not copy them!!!!!!!!!!!!! the device /dev/zero is an infinite
stream of binary zero and will fill your filesystem!

Regards Geofft
>
>Anonymous ftp is working...
>
>The chroot ()ed seems to be working...
>
>...in the /etc/passwd:
>
>cabeyou:x:6376:500:wuftp_user:/xxx/yyy/./cabeyou:/bin/sh
>
>...but the commands do not work:
>
>230 User cabeyou logged in.  Access restrictions apply.
>ftp> pwd
>257 "/cabeyou" is current directory.
>ftp> ls
>200 PORT command successful.
>425 Can't create data socket (0.0.0.0,20): Bad file number.
>ftp> ls -la
>200 PORT command successful.
>425 Can't create data socket (0.0.0.0,20): Bad file number.
>ftp> put .profile
>200 PORT command successful.
>425 Can't create data socket (0.0.0.0,20): Bad file number.
>
>Is it necessary to have a ftp structure ( with etc,dev,...) in the
>/xxx/yyy directory?
>
>Has anyone seen this before?
>
>Regards...
>
>+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+
>| Mauricio Freitas Nogueira                                                 |
>| Telnet / WorldNet - Internet Service Provider                             |
>| http://www.telnet.com.br						    |
>+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+
>| Henrique Monteiro,90 - 9th Floor   Phone/Fax : 55-11-816-5330             |
>| Sao Paulo - SP                     Data-phone: 55-11-816-5888             |
>| 05423-020 BRAZIL                   E-mail:[email-masked] 	    |
>+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+
>
>
Geoff Terry
Systems & Network Support
ACR Net
Sapphire Coast NSW 2550
Australia
Ph 064 923677
Mobile 015 668 227
Fax 064 924594