SMB protocol version of an active cifs mount on Linux [Updated [again]]

In my current-as-of-last-Summer job I got tasked with doing some analysis related to SMB data traffic, and in this context the question arose:

“Which SMB protocol version is this mount using?”

The server in question is running gentoo linux, the client Ubuntu, both of them new-ish. Update: both server and client are using samba (4.1.17 / 4.1.6) to export and mount the share, resp.

To my consternation, the answer is simple but was rather hard to find (for me), so to help other poor souls in the same situation, but mainly to aid my memorising process, I’m writing this down (No altruism here, I’m afraid 😉 ).

so … drum roll … here goes:

$ cat /proc/mounts

on the client, that’s it.

here’s my example (with some obfuscation in place which is irrelevant for the example; bold by me):

$ cat /proc/mounts|grep <sharename>
//<IP>/<sharename>/ <mntpoint> cifs rw,relatime,vers=1.0,cache=strict,username=guest,domain=VMCTRL-1ABCF5AB,uid=0,noforceuid,gid=0,noforcegid,addr=<IP>,file_mode=0755,dir_mode=0755,nounix,serverino,noperm,rsize=61440,wsize=65536,actimeo=1 0 0

to prove that’s what I was looking for, I unmounted the share and re-mounted using ‘-o vers=3.0’, after which the output of the above changed accordingly. QED.

PS: if you know of a way to get this same information from the server side, I’d appreciate a comment. TIA 🙂

2nd Update: In response to my PS: in current-ish versions (I’m looking at 4.4.2, don’t know precisely when this came in), ‘smbstatus’ prints this information with the “PID” group unter “Protocol version” (I shortened the output lines a bit for readability):

smbstatus -p

Samba version 4.4.2
PID     Username     Group        Machine                 Protocol Version...      
22857   nobody       nobody       <IP> (ipv4:<IP>:34567)  SMB2_10...                    


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s