Score:0

Can Samba close a single user session coming from a shared host?

ie flag

If I want to close a user session on a Samba server, the smbcontrol close-share and smbcontrol kill-client-ip commands are available to achieve this. However when dealing with a shared client (a Windows Terminal Server for example) these commands close the session of all users on that client.

Is it possible to close the session of only one user if that session comes from a shared host? I've looked at the smbcontrol, samba-tool and net utilities, and although net rap session looked promising, it doesn't seem to work. I also tried net rpc file CLOSE, but that too doesn't seem to work.

Score:0
ie flag

Answer: yes, it can.

It is possible to list the open files with the command: net rpc file -U $user. The resulting list includes a FileId as first field. A specific file can be closed by using its FileId in this command: net rpc file close $fileid -U $user

Note that the $user used to connect needs to have the SeDiskOperatorPrivilege for the close command to work!

Score:0
cn flag

This post might help you. there are several answers so have a look and let us know if anything was helpful. [1]: https://social.technet.microsoft.com/Forums/en-US/72e66e9c-f55f-47ee-af92-20db0a2daacc/closing-smb-session-on-windows-client

roelvanmeer avatar
ie flag
Thanks, but I am trying to close the session server-side, not client-side, so I'm looking for a linux/samba command to do this.
blond_viper avatar
cn flag
I believe you can kill the login of that user I reckon well or reach out to that user to close the connection on their end.
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.