Subject: Re: Some troubles with "upload..."

From: Gregory A Lundberg <[email-masked]>
Date: Wed, 9 Jun 1999 08:47:08 -0400 (EDT)

On Wed, 9 Jun 1999, Alexander N. Lykov wrote:

> I use RH 6.0 and wu-ftpd-2.4.2vr17-3.i386.rpm.
> 
> I append this in my /etc/ftpaccess
> ----
> upload  /home/ftp  *             no     nobody   nogroup 0000 nodirs
> upload  /home/ftp  /bin          no
> upload  /home/ftp  /etc          no
> upload  /home/ftp  /user1     yes     user1    user1 0600 dirs
> upload  /home/ftp  /user2     yes     user2    user2 0600 dirs
> 
> guestgroup ftpusers
> ----
> and in /etc/passwd
> -----
> user1:x:502:502::/home/ftp/./user1/:/bin/bash
> user2:x:503:503::/home/ftp/./user2/:/bin/bash
> -----
> and in /etc/group
> -----
> ftpusers::51:user1,user2
> -----
> 
> When I login at user1 or user2 and I upload some files in /user1 or
> /user2 then ftp server does not change owner, group and user mask for
> this files.
> 
> I download and install latest verison 2.5.0 of wu-ftp and it does not
> work too. :(

Read upload.configuration.HOWTO, it was included in your 2.5.0 package.

-- 

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

---

From: "Alexander N. Lykov" <[email-masked]>
Date: Thu, 10 Jun 1999 10:03:19 +0700

Hello Gregory,

Wednesday, June 09, 1999, 7:47:08 PM, you wrote:

>> I use RH 6.0 and wu-ftpd-2.4.2vr17-3.i386.rpm.
[...]
GAL> Read upload.configuration.HOWTO, it was included in your 2.5.0 package.
In section "Upload restrictions for guest users" no any about change
owner and group on upload files... Do it mean so I cannot change
owner, group and attribute on upload files by guest user?

Best regards,
 Alexander

---

From: "Ian Guthrie" <[email-masked]>
Date: Wed, 9 Jun 1999 23:35:12 -0700

Re: My WU-FTP chrooted "guest" users

Does anyone have any idea why my chrooted users can still change the names
of /usr, /etc, /bin, etc. under their chrooted directrories and also erase
files that don't belong to them? My file permissions on all of these files
state that they belong to root and are owned by group system, and indeed are
not even writable. My user's permission should be such that they can't even
touch them! They can delete any file in their chrooted directory no matter
the owenerships.

My users are just normal users created in the normal fashion.

When a user FTP's in to their chrooted direory (using the guest-group
method) suddenly possess these powers. Strangely enough, the chroot is
working perfectly, they cannot see the files in /etc, or any directory that
they do not create, nor can they escape their own file structure to any
other part of the file system.

I spent quite a bit of time today trying out all sorts of different senarios
to no avail.

Anyone have any ideas? My only though is that perhaps they are gaining some
sort of root uid when loging in, but I have set everything up so they should
not be able to do that. . .

I'd be greatful for any help!

Ian

---

From: Gregory A Lundberg <[email-masked]>
Date: Thu, 10 Jun 1999 05:46:25 -0400 (EDT)

On Wed, 9 Jun 1999, Ian Guthrie wrote:

> Does anyone have any idea why my chrooted users can still change the
> names of /usr, /etc, /bin, etc. under their chrooted directrories and
> also erase files that don't belong to them? My file permissions on all
> of these files state that they belong to root and are owned by group
> system, and indeed are not even writable. My user's permission should
> be such that they can't even touch them! They can delete any file in
> their chrooted directory no matter the owenerships.
> 
> working perfectly, they cannot see the files in /etc, or any directory
> that they do not create, nor can they escape their own file structure
> to any other part of the file system.
> 
> I spent quite a bit of time today trying out all sorts of different
> senarios to no avail.
> 
> Anyone have any ideas? My only though is that perhaps they are gaining
> some sort of root uid when loging in, but I have set everything up so
> they should not be able to do that. . .

su
cd ~<username>
chmod o+t .

--

---

From: "Ian Guthrie" <[email-masked]>
Date: Thu, 10 Jun 1999 10:06:33 -0400

Thanks for your reply,

I tried the directory permissions as per your suggestion below (although I
think I had tried them before) and ended up with this:

drwx--x--x   6 rick      ricks         512 Jun 10 09:46 rick

Here are the permissions of the files in the directory:

d--x--x--x   2 root     system       512 Jun 09 17:46 bin
d--x--x--x   2 root     system       512 Jun 09 15:13 dev
d--x--x--x   3 root     system       512 Jun 09 16:27 etc
-r--r--r--   1 root     system         5 Jun 10 10:09 poo
d--x--x--x   3 root     system       512 May 21 12:22 usr

With this current set of permissions, when my user "rick" FTPs in, he can
re-name any of these directories and can delete the file "poo." He cannot
delete the directories however, nor can he move out of his chrooted
environment.  I can't understand why a normal user would have the power to
delete a file owned by root. Nor do I understand why he has the power to
re-name a directory that is not even writeable!

Any further ideas?

Ian

---

From: Gregory A Lundberg <[email-masked]>
Date: Thu, 10 Jun 1999 10:23:22 -0400 (EDT)

On Thu, 10 Jun 1999, Ian Guthrie wrote:

> I tried the directory permissions as per your suggestion below
> (although I think I had tried them before) and ended up with this:
> 
           ^
           +- This should be a 't'.

> re-name a directory that is not even writeable!

Yes.  Go buy a book on basic Unix.  Read the section of permissions.

--