[juneau-lug] Re: lock user account with a warning

  • From: "Matt Heavner" <heavner@xxxxxxxxxxxxxx>
  • To: juneau-lug@xxxxxxxxxxxxx
  • Date: Sun, 8 Oct 2006 14:22:25 -0800

The first thing that pops to mind is write your own "shell" and do something
like this:
#!/bin/sh
echo "Your account is locked until you clean your room"
logout

stash that in /bin/custom_shell
make it executable (and w/ -rwxr-xr-x permissions)

Then just
sudo chsh /bin/custom_shell username

I'm sure there are probably buffer overflow/etc type issues if this was a
real production type issue, but based on the message, I'm guessing that
it'll do..  I haven't tested the above, so perhaps the chsh command is a
little different (I'd just edit /etc/passwd, but some folks are squeamish
about that kind of stuff..)

Matt

On 10/8/06, James Zuelow <e5z8652@xxxxxxxxxx> wrote:
>
> Does anyone know of a method to lock a user account and present a message
> or
> warning when that user attempts to log in?
>
> issuing `passwd -l user` will lock the user account out - but the system
> will
> just tell them that they typed the wrong password.
>
> What I'd like is for the system to give an arbitrary message when they
> fail -
>
> "Your account is locked until you clean your room"
>
> is the specific message I have in mind.
>
> Ideas?
> ------------------------------------
> The Juneau Linux Users Group -- http://www.juneau-lug.org
> This is the Juneau-LUG mailing list.
> To unsubscribe, send an e-mail to juneau-lug-request@xxxxxxxxxxxxx with
> the word unsubscribe in the subject header.
>



-- 
| Matt Heavner, Assistant Professor of Physics
| University of Alaska Southeast
| 11120 Glacier Highway, Juneau, AK 99801
| Phone: (907) 796-6403 Fax: (907) 796-6406
| If Heisenberg was uncertain, why are you so sure?


------------------------------------
The Juneau Linux Users Group -- http://www.juneau-lug.org
This is the Juneau-LUG mailing list.
To unsubscribe, send an e-mail to juneau-lug-request@xxxxxxxxxxxxx with the 
word unsubscribe in the subject header.

Other related posts: