Score:0

Samba server - single user connection limit

pl flag

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

Score:0
in flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.