Subject: building anonymous ftp

From: [email-masked] (Dave Stern)
Date: Mon, 17 Apr 1995 15:58:22 -0400 (EDT)

Probably an FAQ but: 
I built wu-ftp on a sun running 4.1.3 and it works fine. I'm now trying to
set up an anonymous ftp account. I've created subdirs for ftp including
etc, bin, dev and usr. dev has the null device, bin has ls, compress etc
usr has a subdir with lib that contains ld.so and libdl.so.* and libc.so.*

The anonymous user can ls but can't ls -l.

I understand that the problem has to do with the lost links to sun shared
libraries but I'm not clear how to fix this.

Thanks

Dave Stern

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                              Hughes STX
                             301-286-6079
 INTERNET- [email-masked]           Goddard Space Flight Center
 DECnet-   DFTNIC::STERN                        Code 933   Bldg 28 Rm W248
                                                Greenbelt, MD 20771
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     Disclaimer:  The opinions reflected above are not shared by 
                  the late Howard Hughes. In fact, they are probably
                  not shared by any other humanoid. I call this creativity.

---

From: Vidiot <[email-masked]>
Date: Mon, 17 Apr 1995 15:56:56 -0500 (CDT)

Dave (and others):

<I built wu-ftp on a sun running 4.1.3 and it works fine. I'm now trying to
<set up an anonymous ftp account. I've created subdirs for ftp including
<etc, bin, dev and usr. dev has the null device, bin has ls, compress etc
<usr has a subdir with lib that contains ld.so and libdl.so.* and libc.so.*
<
<The anonymous user can ls but can't ls -l.
<
<I understand that the problem has to do with the lost links to sun shared
<libraries but I'm not clear how to fix this.

The following script will set up the ftp area.

MB
-- 
System Administrator - Extrel FTMS - Madison WI.
e-mail: [email-masked]
phone: (608) 273-8262  fax: (608) 273-8719  voice-mail: (800) 426-6488 ext 6293
Visit - http://www.ftms.com/vidiot/  (Your link to the world of Star Trek)

#!/bin/sh

# Set this to whoever will maintain your ftp site. root is probably a good bet.
# Your username is another possibility.  ftp is NOT!  No directories or files
# inside ~ftp should be owned by ftp.
YOU=root

# No other parameters should need to be changed

# Get the UID of YOU and ftp
YOUUID=`grep "^$YOU:" /etc/passwd | cut -d: -f3`
if [ "x" = "x$YOUUID" ]; then
  echo User $YOU not found
  exit
fi
FTPDIR=`grep "^ftp:" /etc/passwd | cut -d: -f6`
if [ "x" = "x$FTPDIR" ]; then
  echo ftp home directory not found
  exit
fi

# Find the correct libc.so and libdl.so
LIBC=`ls /usr/lib/libc.so.* | tail -1`
LIBDL=`ls /usr/lib/libdl.so.* | tail -1`

install -d -o $YOU -g wheel -m 755 $FTPDIR
cd $FTPDIR
install -d -o root -g wheel -m 555 bin
install    -o root -g wheel -m 111 /usr/bin/ls bin
install -d -o root -g wheel -m 555 dev
install -d -o root -g wheel -m 555 etc
install -d -o $YOU -g wheel -m 722 incoming
install -d -o $YOU -g wheel -m 755 pub
install -d -o root -g wheel -m 555 usr
install -d -o root -g wheel -m 555 usr/lib
install    -o root -g wheel -m 555 /usr/lib/ld.so  usr/lib
install    -o root -g wheel -m 555 $LIBC usr/lib
if [ "x" != "x$LIBDL" ]; then
install    -o root -g wheel -m 555 $LIBDL usr/lib
fi
install -d -o root -g wheel -m 555 usr/share
install -d -o root -g wheel -m 555 usr/share/lib
install -d -o root -g wheel -m 555 usr/share/lib/zoneinfo
install    -o root -g wheel -m 444 /usr/share/lib/zoneinfo/localtime usr/share/lib/zoneinfo

mknod dev/zero c 3 12
chown root.wheel dev/zero
chmod 444 dev/zero

echo "wheel:*:0:" >etc/group
chown root.wheel etc/group
chmod 444 etc/group

echo "root:*:0:0:::" >etc/passwd
if [ $YOUUID != 0 ]; then
echo "ftpadmin:*:$YOUUID:0:::" >>etc/passwd
fi
chown root.wheel etc/passwd
chmod 444 etc/passwd

exit