Subject: Solaris 2.X installation guide for wu-ftpd 2.4.2

From: James Hawtin <[email-masked]>
Date: Thu, 13 Mar 1997 22:04:55 GMT

Many people have asked how to install wuftpd on solaris 2.X systems, this is
a step by setup guide. Some of issues may vary between solaris 2 version, if
your solaris 2 version has slight differences please mail me them, I have
assumed a minium level of knowledge, such as being able to ftp file, and
extract tar files, and know how to use an editor.

This guide has no warranty, it may not be correct for your system, it could
even damage it, use at your own risk.

Written by James Hawtin

email: [email-masked]

So far this guide has been tested on,

solaris 2.4 X86

This guide is divided into a number of sections.

1) compiliation and installation
2) setting up anonymous ftp
3) where to go from here.

1.1) what version of wuftpd do you have?

Is your version older than 2.4.2-beta13, if so get a new copy this guide is
designed to work with 2.4.2-beta13

The latest version is 

ftp://ftp.academ.com/pub/wu-ftpd/private/wu-ftpd-2.4.2-beta-13.tar.Z

1.2)

Extract the tar file, and type.

cp /usr/share/man/man1m/in.ftpd.1m ~

This file contains alot of useful help in setting up an ftparchive

build sol
su -
<your root password>
cd <where ever your source directory is>
build install
cd /usr/man
catman -M . -w

1.3)

check your inetd.conf

in should contain the following line, if it contains a different one replace
it.

ftp  stream  tcp  nowait  root  /usr/sbin/in.ftpd  in.ftpd -a
   ^^      ^^   ^^      ^^    ^^                 ^^ 
^^ These gaps are tabs not spaces.

The -a option is to use the access file. READ THE MAN PAGE ON ftpaccess.

kill -HUP <the process id of inetd>

1.4)

setup the appropriate /etc files,

/etc/ftpusers

The users not permitted to ftp as.

My list contains

-----snip----
root
daemon
bin
sys
adm
lp
smtp
uucp
nuucp
listen
nobody
noaccess
init
-----snip----

/etc/shells

Valid shells for users

My list contains

-----snip----
/usr/bin/sh
/usr/bin/csh
/usr/bin/ksh
/usr/bin/jsh
/bin/sh  
/bin/csh
/bin/ksh   
/bin/jsh 
/sbin/sh
/sbin/jsh
/oolon/local/bin/tcsh
/oolon/local/bin/bash
-----snip----

see the wuftpd documation about these, to get things working just touch the
files, to start with.

/etc/ftpgroups
/etc/ftpaccess
/etc/ftpconversions
/etc/ftphosts

2) setting up anonymous ftp

we are going to setup an anonymous ftp service, using the path /oolon/ftp
to contain the files.

2.1) setup an ftp user

edit /etc/group
add

ftp::<what ever group number you want>:
In my example.
-----snip----
ftp::2010:
-----snip----

edit /etc/passwd

ftp:x:<what ever uid you want>:<your ftp group>:FTP Daemon:/oolon/ftp:/bin/true
in my example
-----snip----
ftp:x:2001:2010:FTP Daemon:/oolon/ftp:/bin/true
-----snip----

edit /etc/shadow
add the line
-----snip----
ftp:*LK*:8668::::::
-----snip----

Ok, now it is impossible to login as the ftp user....

2.2) populating your ftp archive.

mkdir /oolon/ftp
mkdir /oolon/ftp/bin
mkdir /oolon/ftp/dev
mkdir /oolon/ftp/etc
mkdir /oolon/ftp/pub
mkdir /oolon/ftp/usr
mkdir /oolon/ftp/usr/bin
mkdir /oolon/ftp/usr/lib
(in you want uploads)
mkdir /oolon/ftp/pub/incoming
cd /oolon/ftp
ln -s usr/lib lib
ln -s usr/bin bin

2.3) copying in important files

cd usr/bin
cp /usr/bin/ls /usr/bin/compress /usr/bin/tar .
you may also wish to copy gzip in there.

chmod 111 ls compress tar gzip

cd ../usr/lib

PLEASE NOTE YOUR VERSION NUMBERS OF THESE FILES MAY DIFFER

cp /usr/lib/ld.so.1 .
cp /usr/lib/libc.so.1 .
cp /usr/lib/libdl.so.1 .
cp /usr/lib/libintl.so.1 .
cp /usr/lib/libnsl.so.1 .
cp /usr/lib/libsocket.so.1 .
cp /usr/lib/libw.so.1 .
cp /usr/lib/nss_dns.so.1 .
cp /usr/lib/nss_files.so.1 .
cp /usr/lib/nss_nis.so.1 .
cp /usr/lib/nss_nisplus.so.1 .
cp /usr/lib/straddr.so.2 .

chmod 555 *

ln -s ld.so.1 ld.so 
ln -s libc.so.1 libc.so
ln -s libdl.so.1 libdl.so
ln -s libintl.so.1 libintl.so
ln -s libnsl.so.1 libnsl.so
ln -s libsocket.so.1 libsocket.so
ln -s libw.so.1 libw.so
ln -s nss_dns.so.1 nss_dns.so
ln -s nss_files.so.1 nss_files.so
ln -s nss_nis.so.1 nss_nis.so
ln -s nss_nisplus.so.1 nss_nisplus.so
ln -s straddr.so.2 straddr.so

cd ../../etc

cp /etc/netconfig .

create a group file with

-----snip----
root::0:
ftp::<ftp group>:
-----snip----

create a passwd file with 

-----snip----
root:x:0:0::/:/
ftp:x:<ftp uid>:<ftp group>::/:/
-----snip----

chmod 444 passwd netconfig group

2.4) Now the difficult bit making the devices 

ls -alLF /dev/tcp /dev/udp /dev/ticotsord /dev/zero

This will be in the format.

crw-rw-rw-   1 root     sys       11, 42 Nov  9  1995 /dev/tcp
crw-rw-rw-   1 root     sys       99,  1 Nov  9  1995 /dev/ticotsord
crw-rw-rw-   1 root     sys       11, 41 Aug  4  1994 /dev/udp
crw-rw-rw-   1 root     sys       13, 12 Aug  4  1994 /dev/zero

This is of the format <major> <minor> for example tcp has a major of 11 and
a minor of 42

cd ../dev

We need to mknod each of the files.

mknod <name> c <major> <minor>

So in my example we need to

mknod tcp c 11 42
mknod ticotsord c 99 11
mknod udp c 11 41
mknod zero c 13 12

chmod 444 zero
chmod 644 tcp udp ticotsord

chown root zero tcp udp ticotsord
chgrp sys zero tcp udp ticotsord

2.5) setting up safer access permissions

chmod 555 usr/lib usr/bin usr etc dev
chmod 755 pub

touch .notar
touch pub/.notar

(in you want uploads)

chmod 777 pub/incoming

2.5) I want to tar, and gz files automagically.
Make sure you have copyed gzip into usr/bin

create a /etc/ftpconversions containing

-----snip----
 :.Z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 :   : :.Z:/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
 :.gz: :  :/bin/gzip -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP
 :   : :.gz:/bin/gzip -c %s:T_REG:O_COMPRESS:GZIP
 :   : :.tar:/bin/tar -cf - %s:T_REG|T_DIR:O_TAR:TAR
 :   : :.tar.Z:/bin/tar -cZf - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
 :   : :.tar.gz:/bin/tar -czf - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+GZIP
-----snip----

make sure your /etc/ftpaccess has something like the following in it.

-----snip----
class   all   real,guest,anonymous  *

limit   all   10   Any              /etc/msgs/msg.dead

readme  README*    login
readme  README*    cwd=*

message /welcome.msg            login
message .message                cwd=*

compress        yes             local remote
tar             yes             local remote

log commands real
log transfers anonymous,real inbound,outbound

shutdown /etc/shutmsg

email user@hostname
-----snip----

I would also sugest your ftpaccess has the following in it

-----snip----
delete          no      guest,anonymous         # delete permission?
overwrite       no      guest,anonymous         # overwrite permission?
rename          no      guest,anonymous         # rename permission?
chmod           no      anonymous               # chmod permission?
umask           no      anonymous               # umask permission?

# restrict uploading in the ftp archive

upload  /oolon/ftp  *                          no
upload  /oolon/ftp  /pub/incoming             yes root ftp 0640 nodirs
upload  /oolon/ftp  /bin                       no
upload  /oolon/ftp  /etc                       no
upload  /oolon/ftp  /usr                       no
upload  /oolon/ftp  /private                   no
-----snip----

3) Where to go from here.

We should now have a fullying functioning generic ftp archive, the wuftpd
documenation should help you will the rest, have a look at 
<wu-ftpd_source_directory>/doc/examples/ftpaccess.heavy and read the 
man page on ftpaccess (man ftpaccess)