[olug] Unix Tip: KEEP THAT USER OUT!

Christopher Cashell topher at zyp.org
Fri Dec 13 07:13:55 UTC 2002


At Fri, 13 Dec 02, Unidentified Flying Banana Phil Brutsche, said:
> Creating /etc/nologin is an all-or-nothing.  It doesn't help you if you
> want to temporarily prevent a certain user from loggin in without
> affecting anyone else.
> 
> The only 2 solutions I can think of are:
> 
> 1) Fudge with the authentication information in their account (change
>    their password, change password expiration time, etc)
> 2) The script suggested in the original email

3) Set their shell to '/bin/false'.

If you just want to stop a single person from logging in, the easiest
(and best) way is to set their shell to /bin/false.  This will prevent
them from being able to access the system.

The problem with the script in the original e-mail was that it doesn't
prevent them from loggin in.  It lets them log in, and then knocks them
off the system.  Not only is it somewhat rude, it's also very
inefficient.  A much better way of dealing with things is to prevent
them from logging in to the system in the first place.

> Phil Brutsche

--
| Christopher
+------------------------------------------------+
| A: No.                                         |
| Q: Should I include quotations after my reply? |
+------------------------------------------------+




More information about the OLUG mailing list