1

Is there a limitation for samba server to allow multiple connection's from single user? (Multiple PC's connecting to same samba server with same account) User was created through smbpasswd -a [username]

Server: AlmaLinux 9 Samba version: 4.16.4

Thank for any response

1 Answer 1

0

Yes, you can with a bit of tricky way. You should add preexec script to check if this users is already connected:

[myshare]
    ...
    preexec script = /sbin/PermitSingleLogon.sh
    preexec close = Yes
    ...

And the script itself

#!/bin/bash

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

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

For more details please check the original samba manual.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .