Koozali.org: home of the SME Server

Lock account by script

Offline morpion

  • **
  • 29
  • +0/-0
Lock account by script
« on: August 09, 2010, 11:28:49 AM »
Morning all
I am using SME 7.5.1 and would like to come up with a way to lock a user account by using some sort of script.

We currently administer our personnel on a separate database system. When the employee leaves the company (heaven forbid!), the relevant manager shows them as left and their access to our databases is automatically cancelled. I would like our database system to send a message to SME that locks out the user's account as well so that they have no access to workstations or emails from the moment they are shown as having left.
I cannot find anything which might be able to help me with this but I was thinking along the lines of a shell script that I could invoke remotely or a telnet session or something similar.
If anyone has done something like this then your help would be appreciated.
regards
Mike

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Lock account by script
« Reply #1 on: August 09, 2010, 11:43:24 AM »
you could call, via ssh
Code: [Select]
signal-event user-lock username

you should use shared keys for authentication

for more details:
- check /etc/e-smith/events/user-lock content
- read the developer manual


Offline morpion

  • **
  • 29
  • +0/-0
Re: Lock account by script
« Reply #2 on: August 09, 2010, 11:46:27 AM »
Thanks Stefano
That's just what I'm after.

Many thanks for your help
Mike