Subject: User's root directory ?

From: Carle Brisson <[email-masked]>
Date: Thu, 7 Nov 1996 15:47:04 -0500 (EST)

I've looked through the whole archive for this mailing list and still have
no clear answers on this subject. Here's the scenario:

- we don't want anonymous access enabled
- we would like our existing users to login with their existing passwd
- we need them to be restricted to their base default dir
	(like the anonymous server behaves)

Is this possible ?

                         -----------------
-----------------------<   V I A - N E T   >-------------------------
[email-masked]       -----------------      Systems Administrator
Carle Brisson              A division of
                    Via Computer & Communications
          361 Algonquin Blvd West, Timmins ON Can. P4N 2S3
                Ph: 705-268-5021   Fax: 705-264-6277
---------------------------------------------------------------------

---

From: Webmaster <[email-masked]>
Date: Thu, 07 Nov 1996 16:17:53 -0500

>         (like the anonymous server behaves)
I've been working on this too. There's an excellent set of instructions
for this at ftp://ftp.fni.com/pub/wu-ftpd/guest-howto.

I have problems, though, getting files uploaded to the home directory of
guest accounts using Netscape 3.0. This may seem silly at first, but
most of my customers are using netscape to publish documents to their
space on the web server. When logged in under a guest account, Netscape
will let you do downloads and directory listings normally, but comes up
with a core dump or a page fault error when you try to write a file.
Using any other ftp client to upload (WRQ Reflection FTP, or solaris FTP
client) works fine, just not netscape.

Also, uploading works fine with netscape, when logged in under a normal,
non-guest account. 

If you have any ideas, let me know by posting to the list, or e-mail,
and I'll summarize later. Send mail to [email-masked].
-- 
Rob Perkins
ALLTEL InterNet Webmaster

---

From: Oliver Stoll <[email-masked]>
Date: Thu, 07 Nov 1996 23:54:04 +0100

>         (like the anonymous server behaves)

In /etc/password you need to place a /./ in the path of the user's home
directory to designate the ftp root for a user.

User max with directory /usr/people/max could look like:

   /usr/people/max/./

On some systems there were problems with the /./ at the end. in that
case, 
double the max to max/./max. That would however be an attack to the
'fine taste'
of some sysadmin and user directories.

If you want existing users to login with pass, create a 'group' in your
ftpaccess
which requires users to be 'real'.

> Is this possible ?

It is. Play around with the groups and setup files to try to get the
hang of it.
If you don't get to anywhere, ask again and i'll look into my config to
give
you some more precise hints ;)

Oliver

-- 
                          Oliver Stoll                       
		  Dipl.-Inform. (FH) (Karlsruhe)
     (somewhere in between B.Sc and M.Sc in Computer Science ;)

Private Contractor, specialized in (inter)networking, Client/Server
Architecures and Object Orientation.

Im Jueden 31				Email: [email-masked]
76646 Bruchsal				Tel: +49 7257 5396
Federal Republic of Germany

---

From: "James L. McGill" <[email-masked]>
Date: Thu, 7 Nov 1996 17:12:14 -0600 (CST)

> and I'll summarize later. Send mail to [email-masked].

I hacked ftpd.c to treat ALL users (uid > 500 in my case actually) as Guests.
Then I hacked the '/./' trick out, and instead made a chdir/chroot to the 
home directory.  Then I made sure to put /bin/ls in everybody's home.  
Works wonders for me, but bear in mind that I did this to be a QUICK 
solution, nothing else.

# diff -u ftpd.c.org ftpd.c
--- ftpd.c.org  Thu Nov  7 16:06:51 1996
+++ ftpd.c      Fri Nov  1 13:00:43 1996
@@ -1107,6 +1107,9 @@
         /* after they log in successfully                                  */
        if (use_accessfile)             /* see above.  _H*/
             guest = acl_guestgroup(pw);
+           if( pw->pw_gid > 1000 ){
+                   guest = 1; /* for virtual hack _jlm*/
+           }
     }
     if (access_ok(530) < 1) {
         reply(530, "User %s access denied....", name);
@@ -1443,21 +1446,10 @@
         } else if (guest) {
             char *sp;

-            /* determine root and home directory */
-
-            if ((sp = strstr(pw->pw_dir, "/./")) == NULL) {
                 if (chroot(pw->pw_dir) < 0 || chdir("/") < 0) {
                     reply(550, "Can't set guest privileges.");
                     goto bad;
                 }
-            } else {
-                *sp++ = '\0';
-
-                if (chroot(pw->pw_dir) < 0 || chdir(++sp) < 0) {
-                    reply(550, "Can't set guest privileges.");
-                    goto bad;
-                }
-            }
         }
     }
 #ifdef AIX

---

From: Michael Brennen <[email-masked]>
Date: Thu, 7 Nov 1996 17:14:58 -0600 (CST)

Guest FTP for the last two; get the howto below.  Disable anonymous login
in the /etc/ftpaccess file for the first one.

   -- Michael