[Samba] How can I limit samba users to just one login session?

José M. Fandiño samba at fadesa.es
Fri Aug 20 08:12:17 GMT 2004


"Gerald (Jerry) Carter" wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Donald D Gunn wrote:
> | How can I limit samba users to just one login session?
> |
> | I have some people logging in as the same user several times ..
> | .( don't ask...it's a partner company that has limited access)
> | I have no control over the users other than limiting their
> | login to just once per user.
> 
> Volker just posted a possible patch to the samba-technical
> list.   Probably will be incorporated into 3.0.7.

great :)

I'm using a very simple shell script to deny simultaneous access 
to shares, you can find it useful whilst 3.0.7 isn't out.

regards.

[netlogon] # apply to all shares home,profile,netlogon,public,staff,etc
   preexec = /opt/samba/bin/check-samba %u
   preexec close = yes
   .
   .
   .

#!/bin/bash

IFS="-"
RESULTADO=$(/opt/samba/bin/smbstatus -S -u $1 2> /dev/null | awk 'NF > 6 {print $1}' | sort | uniq -d)

if [ "X${RESULTADO}" == X  ]; then
  exit 0
else
  exit 1
fi


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d- s+:+() a- C+++ UBL+++$ P+ L+++ E--- W++ N+ o++ K- w---
O+ M+ V- PS+ PE+ Y++ PGP+>+++ t+ 5 X+$ R- tv-- b+++ DI D++>+++
G++ e- h+(++) !r !z
------END GEEK CODE BLOCK------


More information about the samba mailing list