From owner-freebsd-isp Wed Jun 25 23:19:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA06067 for isp-outgoing; Wed, 25 Jun 1997 23:19:04 -0700 (PDT) Received: from homer.eaglequest.com (qmailr@[204.157.190.11]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id XAA06058 for ; Wed, 25 Jun 1997 23:19:01 -0700 (PDT) Received: (qmail 30497 invoked from network); 26 Jun 1997 06:12:16 -0000 Received: from homer.eaglequest.com (nick@204.157.190.11) by homer.eaglequest.com with SMTP; 26 Jun 1997 06:12:16 -0000 Date: Thu, 26 Jun 1997 02:12:16 -0400 (EDT) From: Nick Seraphin To: "Tom T. Thai" cc: freebsd-isp@FreeBSD.ORG, linuxisp@friendly.jeffnet.org Subject: Re: system passwd to RADIUS In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-isp@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk No guarantees that it will work for you or that it won't screw up/crash your system. Use at your own risk. (blah blah.. standard legal disclaimers, etc). May need some editing for your version of RADIUS. It's attached below my .signature. -- Nick On Thu, 26 Jun 1997, Tom T. Thai wrote: > Can I have your perl script.. would save me some time. > ------------------------------------------------------------------------------ Nick Seraphin nick@eaglequest.com President http://www.eaglequest.com/ EagleQuest, Inc. (810) 650-4700 Internet Access Services Rochester, Michigan ------------------------------------------------------------------------------ #!/usr/bin/perl # parse.pl # # script to parse unix passwd file and create radius users file # # Configuration # # You may need to change the names/syntax of the RADIUS fields below to # match your dictionary file. # # This script creates a new file from scratch each time it is run. It # also ignores users with "suspended" passwords (users with *'s) # # Change these filenames to match your system. # $passwdfile = "/etc/passwd"; $outputfile = "/etc/raddb/users"; # End of Configuration # open(PASSWD,"$passwdfile") || die "Can't open $passwdfile!\n"; open(USERS,">$outputfile") || die "Can't open $outputfile!\n"; foreach $line () { chop($line); @arr = split(":",$line); if ($arr[1] ne "*") { if (length($arr[0]) == 8) { print USERS "$arr[0]\tEncrypted-Password=\"$arr[1]\"\n"; } else { print USERS "$arr[0]\t\tEncrypted-Password=\"$arr[1]\"\n"; }; print USERS "\t\tService-Type = Framed,\n"; print USERS "\t\tFramed-Protocol = PPP,\n"; print USERS "\t\tFramed-IP-Netmask = 255.255.255.255,\n"; print USERS "\t\tFramed-Routing = None,\n"; print USERS "\t\tFramed-Compression = Van-Jacobson-TCP-IP,\n"; print USERS "\t\tFramed-MTU =1500\n"; print USERS "\n"; } } close(PASSWD); close(USERS);