[scponly] how does scponly determine the writeable, incoming directory ?

Ensel Sharon user at dhp.com
Wed Jan 25 22:54:34 EST 2006


I ran setup-chroot.sh successfully, and further, I read through it line by
line to understand what it was doing.

But I do not see where it sets the writeable, incoming directory to chroot
into when the user logs in.

Here is where it creates the writeable incoming directory:


if [ ! -d $targetdir/$writeabledir ]; then
        echo -e "\ncreating  $targetdir/$writeabledir directory for
uploading files"
        $INSTALL_PATHNAME -o $targetuser -d $targetdir/$writeabledir


So it is creating $targetdir/$writeabledir - makes sense.

And here is where it populates the password database _inside of_ the
chroot:


        else
        #
        #       this is for systems which do have pwd_mkdb            
        #
                /usr/bin/grep $targetuser /etc/master.passwd >
$targetdir/etc/master.passwd
                /usr/sbin/pwd_mkdb -d
"$targetdir/etc" $targetdir/etc/master.passwd
                /bin/rm -rf $targetdir/etc/master.passwd
$targetdir/etc/spwd.db
        fi


But it is getting the information out of /etc/passwd - and /etc/passwd has
just the home directory - it does not have the $targetdir/$writeabledir
... I do not see anywhere in setup-chroot.sh that the
$targetdir/$writeabledir is done anything with.  It is just created and
that's it.

Where and how does setup-chroot.sh tell scponlyc that
$targetdir/$writeabledir is where to chroot the user into ?  The
BUILDING-JAILS file says to:

   The top level /etc/password file is modified for each scponly user,  
   you insert the chrooted path in front of the existing path (With
   a // at the chroot point) and the shell set to your scponlyc location.
                                          
   Original /etc/passwd line
     auser:x:3444:3000:A user:/home/auser:/bin/csh
   Modified /etc/passwd line 
     auser:x:3444:3000:A user:/{altroot}//home/EmptyHomeDir:/sbin/scponlyc

     Where {altroot} is your chosen chroot point for this user,          
     EmptyHomeDir is the chrooted home directory name, and scponlyc is
     the path your installed version.

But the setup-chroot.sh does not do that, as far as I can see.

Help ?




More information about the scponly mailing list