From: unruh@unixg.ubc.ca (Bill Unruh)
Newsgroups: comp.sys.sun.admin
Subject: Re: setting up anonymous ftp
Date: 16 Oct 92 05:51:01 GMT
Organization: The University of British Columbia
Distribution: world
NNTP-Posting-Host: unixg.ubc.ca

narayan@sut.ac.jp (Devendra Narayan) writes:

>In article <Oct15.173004.98047@yuma.ACNS.ColoState.EDU>, arvidson@lagrange
>(John Arvidson  ) wrote:
>> 
>> Hi, can anyone out there help me to implement anonymous ftp on 
>> a sparcstation ipc running SunOS Release 4.1.1?  I don't see 
>> anything on this in the man pages or the sys. and net. adm. guide
>> for sun os.  Thanks, John
>> 
>> arvidson@math.colostate.edu

This is covered in the ftpd man pages on Suns.

>see. The entry in the passwd file should look something like

>ftp::400:400:Anonymous FTP:/home/ftp:/bin/true

No! put in a password, or a star for the password
ftp:*:400:400:Anonymous FTP:/home/ftp:/bin/true


>4) Copy the program ls into ~ftp/bin.  ls is owned by root with permissions

>111 (noread, nowrite, execute).

>5) Create the directory ~ftp/usr.  This directory is owned by root with 
>permissions 555.

>6) Create the directory ~ftp/usr/lib.  This directory is owned by root with

>permissions 555.

>7) Copy the runtime loader ld.so into ~ftp/usr/lib for use by ls.  ld.so is

>owned by root with permissions 555.

>8) Copy the latest version of the shared C library, libc.so.* into
>~ftp/usr/lib for use by ls.  libc.so.* is owned by root with permissions
>555. Run ldconfig.
>**4.1.2 users: you also need to copy /usr/lib/libdl.so.* to /ftp/lib.

Aaargh! Points 4-8 are all there only so ls can run ( and Sun's ls uses
the dynamic linked libraries) Aren't there any static linked copies of
ls so one doesn't need all of this JUNK??!!

>11) Make the directory ~ftp/etc.  This directory is owned by root with 
>permissions 444.

>12) Copy the files /etc/passwd and /etc/group into ~ftp/etc.  These files

These files are needed only so that ls can associate names with the uid
and gid on files when you do ls -lga or dir in ftp. So if you want
teh names of file owners listed put in /etc/passwd, BUT STAR OUT ALL
PASSWORDS. All you need are the name field, the uid field  maybe the
gid field (at least for the ftp entry) and all of the other fields blank
(except a * in the password field for safety). As far as I know you dont
really need either of these files at all if you do not mind having just
numbers listed when anon ftp users do dir or ls -lga (Corrections pls if
I am wrong, but I have run it this way with no passwd or group file at
all)
>13) Make the directory ~ftp/pub.  This directory is owned by ftp with 
>permissions 555.  Files are left here for public distribution.  All folders
>inside ~ftp/pub should have the same permissions, except for the incoming
>folder.

>14)  If you wish to have a place for anonymous users to leave files, create
>the 
>directory ~ftp/pub/incoming.  This directory is owned by root with
>permissions 
>722 (root has all permissions, other users can only write).  Files can be
>left here, but users cannot see what is there, to prevent the spread of
>unauthorized files.

Actually, if you are not setting up a public archive but want anon ftp
to be useful to your users to share files with outsiders without them
handing out their paswords to outsiders to transfer files in or out, you
could have root put in a crontab to erase all files in the pub directory
or subdirectories which are older than three days say. insert a crontab
entry for root of
00 2 * * * find /home/ftp/pub -mtime +3 -exec rm -f {} \;
This will prevent at least some of the misuse of your anon ftp by
cretins to exchange files (often pornographic) with the world.
Also log your anon ftp clients ( and let the outside users know this).


Newsgroups: comp.sys.sun.admin