Perl question

Perl question

Post by Larr » Wed, 05 Dec 2001 07:18:38



I want to make a perl script that will authenticate a user when he
logs in by askin him for his account name, if he enters it correct it
will allow him in, if not it will kill his shell ( Basically I put
this script to run in /etc/profile so it will run on any login, and
actually the user is already logged in, but if he enters a name NOT in
my array, it will kill his shell and kick him out... Should I usean
'awk' command in the script.. any suggestions ??? Thanks alot...

larry

 
 
 

Perl question

Post by daveh.. » Wed, 05 Dec 2001 08:02:04



Quote:> I want to make a perl script that will authenticate a user when he
> logs in by askin him for his account name, if he enters it correct it
> will allow him in, if not it will kill his shell

OK, but why?  Didn't 'login' just do that for you?

 
 
 

Perl question

Post by Robert Sherma » Wed, 05 Dec 2001 08:00:01



> I want to make a perl script that will authenticate a user when he
> logs in by askin him for his account name, if he enters it correct it
> will allow him in, if not it will kill his shell ( Basically I put
> this script to run in /etc/profile so it will run on any login, and
> actually the user is already logged in, but if he enters a name NOT in
> my array, it will kill his shell and kick him out... Should I usean
> 'awk' command in the script.. any suggestions ??? Thanks alot...

why not just give them /dev/null as a shell? or lock their accounts?

for perl advice, you would be better off at comp.lang.perl.misc, but unless you
need to do something besides kick them out, letting them that far in is a bad
idea...you will need to trap signals and such to ensure they can't break out of
the script, and it is unnecessarily complex...and shelling out to yet another
program is just going to make it messier...

--
robert sherman
css3, school of civil and environmental engineering
georgia institute of technology
atlanta, ga, usa

 
 
 

Perl question

Post by KandoCode » Wed, 05 Dec 2001 13:35:00


So once I log in - I can read /etc/profile and see what all the accounts in
the array are?
Huh?


> I want to make a perl script that will authenticate a user when he
> logs in by askin him for his account name, if he enters it correct it
> will allow him in, if not it will kill his shell ( Basically I put
> this script to run in /etc/profile so it will run on any login, and
> actually the user is already logged in, but if he enters a name NOT in
> my array, it will kill his shell and kick him out... Should I usean
> 'awk' command in the script.. any suggestions ??? Thanks alot...

> larry


 
 
 

1. Apache and Perl Question

Hi there,

We run a web server (Apache) and spawn quite a lot of CGI processes for
counters and other various things.  On our busiest page, our front page,
we have a  counter which is a simple Perl script.

Now, when the site becomes busy, the system load increases dramatically
because we have many people all loading the counter (which is a 400K
PERL binary) at the same time.  Is there any way to shrink the PERL
executable size, or would dynamic library linking help this?

(At the moment, I have re-written the piece of CGI in C and it's 13k.  I
know mod_perl would improve things, but is there any other way?)

Thanks y'all :)

Steve
Playgal

2. A couple of things on userfs.

3. perl Question

4. Crontabs on solaris

5. Quick Perl question

6. Mount UFS under Linux (ZIP drive on Linux & Solaris)

7. solaris x86 perl question

8. NFS broken

9. Mod perl question for the web gurus

10. Yet another sed/perl question...

11. easy Perl question

12. perl question...

13. Perl question .....