UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 2197 - January 6, 2006
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KEEPING MORE USERS OUT
Here's an alternate approach to tip 1807, regarding keeping users from logging in during maintenance (or whatever).
Create a file called "nologin" that contains the text of a message to display to denied login attempts. The file location depends on the UNIX variant. BSD-derivatives (including Solaris) seem to favor /etc. Linux prefers /var/run.
Make the file world-readable.
With that file in place, anyone (except root) attempting to log in will be shown the contents of the file, and then dropped. Some variants will (I think) await a keystroke, to be sure the message is seen - others just flash it by.
I don't know if that timing is tuneable.
This is referenced in the man page for the login command.
Several years ago, in an environment where I had to deal with this a lot, I worked up a script (cryptically named "logins") that would either query the state of login acess, or allow me to toggle it on or off quickly. It's not elegant, but it did the job. If anyone is interested, I'd be happy to send it.
8-)
This tip is supported by: swezwho@yahoo.com
--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today
==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.
Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================
Tidak ada komentar:
Posting Komentar