Subject: Re: WU-FTPD (still) won't chroot!

From: "Jason Kantz" <[email-masked]>
Date: Wed, 30 Sep 1998 12:49:30 PDT

Still no chroot.
First in this message is the ftp session, and below is my configuration.
----------------------------------------------------------------
# ftp ash
Connected to ash.aquinas.edu.
220 ash.aquinas.edu FTP server (Version wu-2.4(1) Fri Jul 10 23:36:51 
EDT 199
8) ready.
Name (ash:aqadmin): sam
331 Password required for sam.
Password:
230 User sam logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/home/users/sam" is current directory.
ftp> user
(username) jason
530 Can't change user from guest login.
Login failed.
ftp>

----------------------------------------------------------------
I set up the following directory structure:

-rw-rw-r--   root     system     /etc/msgs/msg.dead
drwxr-xr-x   root     system     /home/users
-rw-r--r--   root     system     /home/users/welcome.msg
d--x--x--x   root     system     /home/users/bin
---x--x--x   root     system     /home/users/bin/ls
d--x--x--x   root     system     /home/users/etc
-rw-r--r--   root     system     /home/users/etc/passwd
-rw-r--r--   root     system     /home/users/etc/group
d--x--x--x   root     system     /home/users/etc/msgs
-rw-r--r--   root     system     /home/users/etc/pathmsg
drwxr-s--t   sam      system     /home/users/sam

In /etc/passwd:
sam:*:207:15:Sam I Am:/home/users/./sam:/bin/sh 
[the star is because of C2 security]

In /etc/group:
users:*:15:sam
ftponly:*:203:sam

In /home/users/etc/passwd:
root:*:0:0::/:
sam:*:207:15::/sam:

In /home/users/etc/group:
system::0:
users::15:

The ftpaccess file (in /usr/local/etc):

class   gs   guest *
class   rl   real  *
limit   gs   10   Any /etc/msgs/msg.dead
message /welcome.msg login gs
path-filter gs /etc/msgs/pathmsg ^[-A-Za-z0-9_\.]*$  ^\.  ^-
path-filter rl /etc/msgs/pathmsg ^[-A-Za-z0-9_\.]*$  ^\.  ^-
email [email-masked]
delete          no      guest   # delete permission?
overwrite       no      guest   # overwrite permission?
rename          no      guest   # rename
chmod           no      guest   # chmod permission?
umask           no      guest   # umask permission?
passwd-check rfc822 enforce
guestgroup ftponly

In /etc/fstab:
root_domain#root   /       advfs  rw 0 0
home_domain#home   /home   advfs  rw 0 2

This also might be related to the problem ... the chroot command doesn't 
work.  For example:
# cp /bin/sh /home/users/sam/sh
# cd /home/users/sam
# ls -l
-rwxr-xr-x   1 root     system    131072 Sep 30 15:03 sh
# chroot /home/users/sam ./sh
./sh: not found

However when I had set up anonymous ftp on this system the wu-ftp did
chroot to my ~ftp directory. 
?
Jason

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

---

From: Gregory A Lundberg <[email-masked]>
Date: Wed, 30 Sep 1998 16:20:41 -0400 (EDT)

> sam:*:207:15:Sam I Am:/home/users/./sam:/bin/sh 

Could someone tell this guy the command two update the users database on
DEC Unix 4?  I've been told that after you update the /etc/passwd file,
you need to run somehting but I don't run DU4 so I don't know the command.

> # chroot /home/users/sam ./sh

Everything else looks fine.  but this is the wrong test.  Try this to test
the chroot environment wu-ftpd will use for 'sam':

chroot  /home/users  /bin/ls -alR

This test isn't perfect, since it uses superuser permissions instead of
sam's but it will tell you if everything you absolutely need to have is
there.

-- 

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195