|
|
 |  |
Re: Unix Scripts, etc...From: Matt Simerson Date: Thursday, September 24, 1998
Time: 9:16:09 pm
I've got one that I snagged from:
# Copyright 1998 Stathy Touloumis stathy@jaske.com
# JASKE.COM, Inc. http://www.jaske.com
that runs on BSDI quite nicely. FreeBSD and BSDI are close relatives and
use similar passwd files. In fact, my FreeBSD system can use the BSDI
passwd file (but not vice versa). I think Shawn posted it in the user
contributions section of the Optigold web site. I don't know where that
is. It's allows you to disable and enable passwords. Here's what I use
in the rsh sections of Optigold:
Create:
rsh dns.michweb.net -l radius "sudo /usr/sbin/adduser -p <Pass> -g
user -s /bin/resh -h /usr/home -G <FName> <LName>,,, <Login> ;
/etc/update.passwd"
Hold:
rsh dns.michweb.net -l radius "sudo /usr/local/sbin/modify_user -h
<Login>; /etc/update.passwd"
Restore:
rsh dns.michweb.net -l radius "sudo /usr/local/sbin/modify_user -r
<Login>; sudo /etc/update.passwd"
Cancel:
rsh dns.michweb.net -l radius "sudo rm -r ~<Login>; sudo /usr/sbin/rmuser
<Login>; sudo /etc/update.passwd"
Email Only:
rsh dns.michweb.net -l radius "sudo /usr/sbin/adduser -p <EPass> -g
emailonly -s /bin/ush -h /usr/home -G <FName> <LName>,,, <Email> ;
/etc/update.passwd"
Delete Email:
rsh dns.michweb.net -l radius "sudo rm -r ~<Email>; sudo /usr/sbin/rmuser
<Email>; sudo /etc/update.passwd"
Allow me to explain a few things. The systax of rsh is:
rsh host.domain.com -l username "command"
So, I'm running the command in quotes as the user "radius" on the host
dns.michweb.net. Make sure you have tcpwrappers and your .rhosts file(s)
set up to allow the command execution from your NT host.
You'll also notice I'm running sudo. Since I'm allowing the NT host
permission to rsh and the commands require root priviledges you need a way
of securely allowing the user to execute scripts as root.
The update.passwd script is merely a bash script that uses rdist to copy
the updated passwd files to each of my servers through a ssh tunnel.
You'll notice the only differences between a full user and a email only
user is group membership and shell. I use group membership with Cistron
radius to disallow emailonly accounts from logging on and a custom program
called "ush" that gives users a message telling them they don't get shell
access. If they log into a mail server, ush is symlinked to pine so they
can check their email that way.
I haven't gotten ambitious enough to write scripts to automatically add a
domain to my server(s). I'm halfway there in that I have scripts to auto
update dns for adding domains but I need to write one that appends the
httpd.conf stuff to the end of the file and adds domain->user mappings to
the qmail config files. When I get around to it I'll post it here but it
will be BSDI specific and it will only support bind 8, apache 1.3 and
qmail.
Matt
On Thu, 24 Sep 1998, Robert Hough wrote:
> At 10:29 PM 9/24/98 -0400, you wrote:
> >Since passwd files aren't the same between various flavors, it would be
> >helpful to mention your flavor of choice.
>
> FreeBSD 2.2.7, I assume too much sometimes. hehe
>
> __ _______
>
|

Return to Digital Point Solutions' Home Page |