Score:0

Read "smbstatus --shares" data from application

cn flag

I want to create an application that shows who is connected to the samba server.

How can I read --shares data.
Where is that data located?

I'm using Ubuntu 18.04 with Samba4.

Score:0
es flag

It doesn't exist anywhere except in your terminal but you can send the output to a file if you want:

sudo smbstatus --shares > /path/to/file
Score:0
id flag

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
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.