Subject: Re: Virtual FTP and Solaris 2.5

From: [email-masked] (Paul Fincher (CACI))
Date: Mon, 24 Jun 1996 14:31:50 -0400

Pat,

 >I'm getting the following message when I use the 'ls' command, logged on as
 >'anonymous':
 >
 >        425 Can't create data socket (0.0.0.0,20): Bad file number.
 >
 >System configuration is Solaris 2.4 on a Sun Sparc, with wu-ftpd 2.4.  All I
 >have in my ~ftp/dev directory is the 'zero' device, created with the command:
 >        mknod zero c 3 12
 >

   I had to have tcp in my dev directory also! I also had to use a statically 
linked ls in order for 'ls -l' to work! Look for ftp-ls on the web. You can get 
it at ftp://ftp.funet.fi/pub/local/src/ftpd-ls.tar.gz. Good luck!
   
Paul Fincher
J-MASS Operational Support
[email-masked]

---

From: Chaya Limchitti <[email-masked]>
Date: Tue, 25 Jun 1996 09:24:02 -0700 (GMT)

Hi!
	I got this somewhere in Internet. This may be your answer.
You should edit "ftphome" variable too.

Cheer!
-Chaya Limchitti.

--------------------------cut here-------------------------------
#!/bin/sh
ftphome="/export/ftp"
echo Fixing ${ftphome} for SunOS 5.x

grep '^ftp:' /etc/passwd >/dev/null
if [ $? != "0" ] ; then
	echo adding user ftp
	echo ftp:x:30000:30000:Anonymous FTP:$ftphome:/nosuchshell >> /etc/passwd
	echo ftp:NP:6445:::: >> /etc/shadow
fi

mkdir $ftphome

mkdir $ftphome/pub
mkdir $ftphome/bin
mkdir $ftphome/dev
mkdir $ftphome/etc
mkdir $ftphome/usr

mkdir $ftphome/usr/lib

cp /usr/bin/ls ${ftphome}/bin
chmod 111 ${ftphome}/bin/ls

#The following are needed for basic operation
cp /usr/lib/ld.so* ${ftphome}/usr/lib
cp /usr/lib/libc.so.1 /usr/lib/libdl.so.1 ${ftphome}/usr/lib
cp /usr/lib/libintl.so.1 /usr/lib/libw.so.1 ${ftphome}/usr/lib
cp /etc/passwd /etc/group /etc/netconfig ${ftphome}/etc

echo "You might not want the current full copy of your /etc/passwd file in ${ftphome}/etc"

#The following are needed for 'ls' to resolve NIS names
cp /usr/lib/nss*.so.1 ${ftphome}/usr/lib
cp /usr/lib/libnsl.so.1 ${ftphome}/usr/lib
cp /usr/lib/straddr.so ${ftphome}/usr/lib
cp /etc/nsswitch.conf ${ftphome}/etc

chmod 555 ${ftphome}/usr/lib/*
chmod 444 ${ftphome}/etc/*

# make device nodes. ticotsord and udp are necessary for
# 'ls' to resolve NIS names.
prefix="/devices/pseudo/mm@0:"

for device in zero 
do
	line=`ls -l ${prefix}${device} | sed -e 's/,//'`
	major=`echo $line | awk '{print $5}'`
	minor=`echo $line | awk '{print $6}'`
	rm -f ${ftphome}/dev/${device}
	mknod ${ftphome}/dev/${device} c ${major} ${minor}
done

prefix="/devices/pseudo/tl@0:"

for device in ticotsord 
do
	line=`ls -l ${prefix}${device} | sed -e 's/,//'`
	major=`echo $line | awk '{print $5}'`
	minor=`echo $line | awk '{print $6}'`
	rm -f ${ftphome}/dev/${device}
	mknod ${ftphome}/dev/${device} c ${major} ${minor}
done

prefix="/devices/pseudo/clone@0:"

for device in tcp udp
do
	line=`ls -l ${prefix}${device} | sed -e 's/,//'`
	major=`echo $line | awk '{print $5}'`
	minor=`echo $line | awk '{print $6}'`
	rm -f ${ftphome}/dev/${device}
	mknod ${ftphome}/dev/${device} c ${major} ${minor}
done
chmod 666 ${ftphome}/dev/*

#put chmod's at end
chmod 555 $ftphome/usr/lib
chmod 555 $ftphome/usr
chmod 555 $ftphome/bin
chmod 555 $ftphome/dev
chmod 555 $ftphome/etc

#chmod 777 $ftphome/pub
chmod 755 $ftphome/pub
chmod 555 $ftphome

# in case some of the files existed before and were not owned by root
chown -R root $ftphome

#sfb exit for now
exit

# This is for the wuarchive ftp server
echo Setting up wuarchive FTP server
cp -r /usr/local/etc/msgs ${ftphome}/etc
chmod -R a+r ${ftphome}/etc/msgs
chmod a+x ${ftphome}/etc/msgs

cp -r /usr/local/etc/msgs /etc
chmod -R a+r /etc/msgs
chmod a+x /etc/msgs

if [ ! -f /usr/sbin/in.ftpd.orig ]; then
	mv /usr/sbin/in.ftpd /usr/sbin/in.ftpd.orig
fi
cp /export/local/etc/ftpd /usr/sbin/in.ftpd