Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] deadmanish login?



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-




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org