|
|
 |  |
Automated server setup scriptsFrom: Matt Simerson Date: Friday, March 5, 1999
Time: 9:42:47 am
On Fri, 5 Mar 1999, Michael R. Thompson wrote:
> >Depending on what your servers are, there's probably a better way to do
> >this. I use Unix workstations (BSDI & FreeBSD) and have one Central
> >authentication database located on a file server. The file server doesn't
> >perform any services other than serving files. Then, every other server's
> >database get's synced with the file servers copy.
>
> Thanks. I'd like to see the scripts.
For your sake, and probably a few others, I'll post them in this email.
ADDING A USER to your Unix systems:
Command Line example: (expects BSDI adduser script)
rsh my.file.server -l specialuser "sudo /usr/sbin/adduser -p <Pass>
-g user -s /bin/resh -h /usr/home -G <FName> <LName>,<City>,,
<Login>;/etc/update.passwd"
This one is pretty easy. It rsh's to the file server as a special user
that has a few special priviledges granted by sudo. You'll obviosly
need to have rsh access set up for the Optigold host(s). It runs the
adduser script with all the users info and then runs the special
"update.passwd" script. The update.passwd script looks like this:
#!/bin/bash
rdist -P /usr/local/bin/ssh -f /etc/distfile pass
Pretty simple eh? What's it do you ask? Rdist is a protocol designed
for syncing files across multiple computers. It's the perfect tool for
this. The -P option tells it to use ssh. You don't want to send password
files across your network unencrypted. The -f tells it to use the
/etc/distfile for its settings and the "pass" tells it which "group" of
files to update. My /etc/distfile looks like this:
PASS_FILES = ( /etc/passwd /etc/master.passwd /etc/pwd.db /etc/spwd.db
/etc/login.conf /etc/group )
PASS_SERVER = ( host1 host2 host3 host4 )
pass: ${PASS_FILES} -> ${PASS_SERVER}
The first lines specifies the files to send, the second specifies the
server list to send the files to and the last is the actual definition
of what you want to happen. Mine is considerably more complicated and
you can do other fun things with rdist but this is a working example to
get you started.
Telnet example: (it expects BSDI 4.0 adduser, YMMV)
ogin: specialuser
assword: secret
$ sudo /usr/sbin/adduser -p <Pass> -g user -s /bin/resh <Login>
Full Name: <FName> <LName>
Office: <City>
Office Phone:
Home Phone:
directory
$ sudo /etc/update.passwd
$ exit
CANCELLING A UNIX USER
RSH example:
rsh my.file.server -l specialuser "sudo rm -r ~<Login>; sudo
/usr/sbin/rmuser <Login>; sudo /etc/update.passwd"
Telnet example:
ogin: specialuser
assword: secret
$ sudo rm -r ~<Login>
$ sudo /usr/sbin/rmuser <Login>
$ sudo /etc/update.passwd
$ exit
Anyway, you get the idea. The rest of the scripts are very similar. You
just write what you need done in a script and make a call to it.
Matt
``````````````````````````````````````````````````````````````````
Matt Simerson http://users.michweb.net/~matt
MichWeb Inc. - President http://www.michweb.net
The Art Farm - Technical Wizard http://www.theartfarm.com
ISP/C - Treasurer http://www.ispc.org
No one can make you feel inferior without your consent.
-- Eleanor Roosevelt
``````````````````````````````````````````````````````````````````
-------------------------------------------
To subscribe, unsubscribe and list archive
please visit http://www.data-point.com/lists
-------------------------------------------
|

Return to Digital Point Solutions' Home Page |