server – Read smbstatus –shares datas froman application

Use sudo smbstatus to show the shares and who / what is connected.

Example:

terrance@Intrepid:~$ sudo smbstatus

Samba version 4.11.6-Ubuntu
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
----------------------------------------------------------------------------------------------------------------------------------------
651248  nobody       nogroup      10.0.0.100 (ipv4:10.0.0.100:51922)        SMB3_11           -                    -    

Service      pid     Machine       Connected at                     Encryption   Signing
---------------------------------------------------------------------------------------------
storage      651248  10.0.0.100    Sat Sep  4 10:24:44 AM 2021 MDT  -            -
IPC$         651248  10.0.0.100    Sat Sep  4 10:24:41 AM 2021 MDT  -            -

Locked files:
Pid          User(ID)   DenyMode   Access      R/W        Oplock           SharePath   Name   Time
--------------------------------------------------------------------------------------------------
651248       65534      DENY_NONE  0x100081    RDONLY     NONE             /media/storage   Disney Parks   Sat Sep  4 10:24:45 2021
651248       65534      DENY_NONE  0x100081    RDONLY     NONE             /media/storage   Disney Parks   Sat Sep  4 10:24:45 2021
651248       65534      DENY_NONE  0x100081    RDONLY     NONE             /media/storage   .   Sat Sep  4 10:24:43 2021
651248       65534      DENY_NONE  0x100081    RDONLY     NONE             /media/storage   .   Sat Sep  4 10:24:43 2021
651248       65534      DENY_NONE  0x100081    RDONLY     NONE             /media/storage   .   Sat Sep  4 10:24:43 2021