Search Again:

Re: Telnet Settings

From: Michael Phillips
Date: Sunday, July 12, 1998
Time: 3:15:39 pm

OK Fellow OptiGold users. As I mentioned, here is my scripts that I am using
to add users and delete users. I still haven't figured out how to remove the
customers from RADIUS or place on hold/restore. Once I figure that out, I
will post that here also. Again, feel free to contact me for assistance and
remember, I am running on REDHAT 5.0.

Mike


CREATE ACCOUNT SCRIPT
=====================

Wait For Send Text
---------------------------
login: my login
Password: my password
$ su - root
Password: root's password
# aduser <Login> <FName> <LName>
# passwd <Login>
password: <Pass>
password: <Pass>
# exit
$ exit

CHANGE PASSWORD SCRIPT
======================
login: my login
Password: my password
$ su - root
Password: root's password
# passwd <Login>
password: <Pass>
password: <Pass>
# exit
$ exit

CANCEL ACCOUNT SCRIPT
======================
login: my login
Password: my password
$ su - root
Password: root's password
# deluser <Login>


Redhat ADUSER script that I am using to add users using Optigold Telnet
========================================================================

#!/bin/bash
#
# adduser 1.3: a utility to add users to the system
#
# Copyright (C) 1994 Ian A. Murdock <imurdock@shell.portal.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Written for the Debian Linux distribution (01/21/94). Feel free to use
# it in YOUR distribution, too. :) Please note that this is just a simple
# script that _somewhat_ automates the really boring and repetitive task
# of creating new user accounts. It makes no attempt to be sophisticated.
# Let me know if you improve it in any way.
#
# I need to write a man page for this.
#
# Modified by Marc Ewing <marc@redhat.com> for RHS Linux
# Modified by Michael K. Johnson <johnsonm@redhat.com> for optional
# shadow password support.

# Everything happens too fast, so don't let the user interrupt.
trap "" 1 2 3 15

# Set a few important variables before getting started.
NUMARG=$#
LOGIN="$1"
EXIST=0

FNAME="$2"
LNAME="$3"
PASS="$4"

PLOCK="/etc/.pwd.lock" # Standard method of locking the password file.
RADIUS="/etc/raddb/users"

# A few sanity checks...
if [ `id -u` != 0 ]; then
echo "Only root may add users to the system." ; exit 1
fi

if [ $NUMARG = 0 ]; then
echo "You need to specify the login to add; for example, \`adduser" \
"imurdock'." ; exit 1
fi

id $LOGIN >/dev/null 2>/dev/null && EXIST=1

if [ $EXIST = 1 ]; then
echo "The login $LOGIN already exists."
exit 1
fi

if [ -f $PLOCK ]; then
echo "$PASSWD is locked. Try again later." ; exit 1
fi

#
# Now we begin the program
#
touch $PLOCK ;

useradd -c "$FNAME $LNAME" -g 100 -M -s /bin/false $LOGIN

#
# add user to radius files
#
echo "$LOGIN Auth-Type = Local, Password = $PASS" >>$RADIUS
echo " Framed-Protocol = PPP," >>$RADIUS
echo " Idle-Timeout = 900" >>$RADIUS

# Send a welcome letter
elm -s"Welcome to CVIS" $LOGIN < /etc/welcome

#rebuild broadcast list
/root/bin/buildexcep

# transfer stuff to desoto
/root/bin/txpass

rm -f $PLOCK

# EOF


REDHAT DELUSER SCRIPT
=====================

#!/bin/bash
#
# Everything happens too fast, so don't let the user interrupt.
trap "" 1 2 3 15

# Set a few important variables before getting started.
NUMARG=$#
LOGIN="$1"
EXIST=0

userdel $LOGIN
rm -r /var/spool/mail/$LOGIN
rm -f /etc/.pwd.lock

#
# Here is where I will add the radius stuff
#

#rebuild broadcast list
/root/bin/buildexcep

# EOF



----------------------------------------------
Michael Phillips KF4PFW
Coosa Valley Internet Services
302 E Coosa St. Talladega, AL 35160
mike@coosavalley.net 256-362-3190




Messages In This Thread:



Return to Digital Point Solutions' Home Page