Subject: WU-FTPD Setup script

From: [email-masked]
Date: Mon, 4 May 1998 13:23:00 -0700 (PDT)

At some point awhile ago I saw a short 40-50 line script which created
and setup wu-ftp directories for chrooted groups. Does anyone know where I can
get this script from, I seem to have lost my copy and need it again rather
urgently.

				Richard

==========================================================
Richard Peiper		Supernews Inc.
Work: 706 208 0691	Director, Web Hosting Development
GO BRAVES!		Email: [email-masked]
GO CAPS!		http://www2.supernews.com
==========================================================

---

From: Gregory A Lundberg <[email-masked]>
Date: Mon, 4 May 1998 16:40:23 -0400 (EDT)

I was gonna post it, but it's long .. Get it from the list archive.
Here's the message header info ...

Message-Id: <Pine.GSO.3.96.971029091531.8809g-100000@rintintin>
Date: Wed, 29 Oct 1997 09:21:25 -0800 (PST)
Reply-To: [email-masked]
Sender: [email-masked]
From: Philip Hallstrom <[email-masked]>
To: [email-masked]
Subject: Script to make a chrooted environment...

On Mon, 4 May 1998 [email-masked] wrote:

> Date: Mon, 4 May 1998 13:23:00 -0700 (PDT)
> From: [email-masked]
> To: [email-masked]
> Subject: WU-FTPD Setup script
> 
> 

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195

---

From: "Roy S. Rapoport" <[email-masked]>
Date: Mon, 4 May 1998 13:47:22 -0700 (PDT)

> get this script from, I seem to have lost my copy and need it again rather

I don't know where you saw yours, but this is what we use here:

---
#! /bin/csh -f
 
# A script that will create a new ftp user, create their home
directory,
# put all the right files (/dev/*, /etc/*, etc) in it, chown it,
etc
 
# Where to put all the home directories?
set homeroot = "/home" 
 
# What program to use to create the user?
set useradd = "/usr/sbin/useradd" 
 
# What shell should we use?
set shell = "/bin/true" 
 
# Where's the skeleton tar file?
set skeltar = "/usr/local/lib/skel.tar"
 
# What temporary file can I use?
set tempfile = "/tmp/create_user.$$"
 
# What group should the new user belong to?
set group = 666
 
if ($#argv != 2) then
        echo "Usage: $0 <username> <encryptedpassword>"
        exit 
endif
 
set user = $1
set pass = '$2'

set homedir = "/home/$user"
 
set homedir_inpass = "$homedir/./."
 
$useradd -d $homedir_inpass -s $shell -g $group $user
 
mkdir $homedir
cd $homedir
tar xfp $skeltar
chown  $user $homedir
 
# The home directory is ready.
# Now, we need to change the password for $user
# We'll be using ed because ed can make the changes in place.
# First, create the input file for ed
# 
# Command one: Go to the line containing our user
/usr/bin/echo "/^$user\072" >! $tempfile
# Command two: Change the password
/usr/bin/printf 's/:[^:]*/:%s/\n' '$pass' >> $tempfile
# OK, go back into command mode (.), write the file (w), and quit (q)
/usr/bin/printf ".\nw\nq\n" >> $tempfile
 
# OK, hit the shadow file with ed
/usr/bin/ed /etc/shadow < $tempfile
 
/bin/rm $tempfile

---