[Discuss] deadmanish login?

Dan Ritter dsr at randomstring.org
Mon Jan 30 20:46:51 EST 2017


On Mon, Jan 30, 2017 at 08:20:39PM -0500, Eric Chadbourne wrote:
> Just had this crazy thought.
> 
> What if when I login to my server, if I don't issue a particular command within some time period, a certain action happens.
> 
> For example, say I SSH in, and within 5 minutes type foo. If "I" don't type foo, the server kicks me out, closes port 22, and sends an alert email to our team.
> 
> Does anything already do this type of stuff? I figure it shouldn't be hard to script up in a bored afternoon.
> 
> Reason is I sometimes work with vendors who I think suck and don't want them to be lazy and use my account. Use their own. Grrr.

There are a number of stories of traps like this.

First off, you should be using ssh keys and not passwords.

Second of all, you should make sure that what you are doing is
legal and won't get you arrested.

Obvious implementation methods:

 - turn on shell logging to a non-standard location. Every time
   you log in, run a date command. Last thing when you log out, 
   run another one. Now you have timestamps of what you did.

 - run a script from your .bashrc which spawns a background job.
   The background job sleeps for 300 seconds, then does things
   based on whether a particular file exists.
 
 - or run a script from your .bashrc which kills your shell if it
   isn't interrupted in ten seconds. Make "killall shellkill"  

 - run an init script that looks for a particular file, and if it finds it,
   deletes it and exits. (Best make sure you don't have any
   unexpected reboots.) It if doesn't find the file, do
   whatever.

-dsr-




More information about the Discuss mailing list