Subject: /etc/passwd .vs. ~ftp/etc/passwd

From: Albert Etienne <[email-masked]>
Date: Fri, 06 Nov 1998 12:59:04 -0600

SunOS alpha 5.6 Generic_105181-08 sun4u sparc SUNW,Ultra-5_10
FTP server (Version wu-2.4.2-academ[BETA-18-VR10](1)

It appears that the only way to get the correct action when logged in as

anonymous and using cd ~ and cd ~ftp
is the following:

alpha# grep ftp /etc/passwd
ftp:x:100:100:Anonymous FTP:/usr/local/ftp/./pub:/bin/false

alpha# grep anonymous-root ftpaccess

You get the following

220 alpha FTP server (Version wu-2.4.2-academ[BETA-18-VR10](1) Thu Nov 5
11:57:53 CST 1998) ready.
Name (alpha:etienalb): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230-Fri Nov  6 12:43:24 1998, 760281K free space available in /pub
230-
230 Guest login ok, access restrictions apply.
ftp> cd ~
250 CWD command successful.
ftp> pwd
257 "/pub" is current directory.
ftp> cd ~ftp
250 CWD command successful.
ftp> pwd
257 "/pub" is current directory.

if you do use the anonymous-root directive with the same /etc/passwd
entry for ftp:

alpha# grep ftp /etc/passwd
ftp:x:100:100:Anonymous FTP:/usr/local/ftp/./pub:/bin/false

alpha# grep anonymous-root ftpaccess
anonymous-root  /usr/local/ftp  all

then cd ~ goes to the chrooted /  and not the /pub , but cd ~ftp goes to
the chrooted /pub

220 alpha FTP server (Version wu-2.4.2-academ[BETA-18-VR10](1) Thu Nov 5
11:57:53 CST 1998) ready.
Name (alpha:etienalb): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
ftp> pwd
257 "/" is current directory.
ftp> cd ~
250 CWD command successful.
ftp> pwd
257 "/" is current directory.
ftp> cd ~ftp
250-Fri Nov  6 12:50:11 1998, 760281K free space available in /pub
250-
250 CWD command successful.
ftp> pwd
257 "/pub" is current directory.

This is with the following entry for ~ftp/etc/passwd in both cases.

alpha# grep ftp /usr/local/ftp/etc/passwd
ftp:x:100:100:Anonymous FTP:/pub:/bin/false

It appears that the daemon never consults the ~ftp/etc/passwd file, in
any configuration, with respect to the cd ~ variants.
Which is not what I take the ftpaccess man page to say.  But I think
there is some confusion on my part.
Is "the anonymous user", ftp,  different from "anonymous users" as
mentioned in the manpage?

Thanks,
al

[email-masked]

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 6 Nov 1998 15:59:47 -0500 (EST)

> 257 "/pub" is current directory.

This is correct behavior.

> 257 "/pub" is current directory.

This is incorrect behavior.  I'll take a look at it.  It should cd to the
home directory for 'ftp' given in ~ftp/etc/passwd and cd ~ should take you
there as well.

> any configuration, with respect to the cd ~ variants. Which is not
> what I take the ftpaccess man page to say.

It should.  I'll take a look at this.  I probably was more concerned in my
testing that it work properly for guest users.  and my ftp user's home
directory is the same as the chroot point, so I wouldn't see this.  My
oversight, I'll test and see if a correction is needed.

> But I think there is some confusion on my part. Is "the anonymous
> user", ftp, different from "anonymous users" as mentioned in the
> manpage?

No.  They refer to the same concept, the Unix user 'ftp' logged into the
server using the username 'ftp' or 'anonymous'

-- 

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

---

From: Gregory A Lundberg <[email-masked]>
Date: Sat, 7 Nov 1998 15:40:34 -0500 (EST)

> > FTP server (Version wu-2.4.2-academ[BETA-18-VR10](1)

I have tested the anonymous-root and ~ftp/etc/passwd functionality for
VR10 and it appears to be working correctly.

With anonymous-root specified in the ftpaccess file the home directory
entry for 'ftp' in /etc/passwd is not used and the home directory entry
for 'ftp' in <anonymous-root>/etc/passwd determines the cwd at startup and
the target of the 'cd ~' (CWD ~) command.

Without anonymous-root, and with /./ in the /etc/passwd home directory for
'ftp', the chroot is to the part to the left and the cwd is the part to
the right, just as we'd expect.  The ~ftp/etc/passwd is used for other
users and for 'cd ~ftp' but not for 'cd ~', as we'd expect.

This leads me to the believe the problems you're having with these
features are due to the specific setup you're using rather than the daemon
itself.

--