How can I tell what version of SMB is negotiated when I connect to a share from macOS?
I have quite a few file servers at work that serve up files over SMB/CIFS.
How can I tell what version is negotiated when someone says that I need to be sure I'm connecting over SMB version 3 to get best performance?
The smbutil
command can dump the attributes for all shares or you can target one particular share and parse out the version string:
smbutil statshares -a
In the case of the listing below:
site-test-mbp01:~ me$ df
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk1s1 975210568 368841648 602865928 38% 1808606 9223372036852967201 0% /
devfs 706 706 0 100% 1222 0 100% /dev
/dev/disk1s4 975210568 2097200 602865928 1% 2 9223372036854775805 0% /private/var/vm
map -hosts 0 0 0 100% 0 0 100% /net
map auto_home 0 0 0 100% 0 0 100% /home
/dev/disk3s1 7813365344 1387760392 6424657392 18% 28307 9223372036854747500 0% /Volumes/apfs
com.apple.TimeMachine.2018-03-29-120539@/dev/disk1s1 975210568 367917520 602865928 38% 1809465 9223372036852966342 0% /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/site-test-mbp01/2018-03-29-120539/Macintosh HD
com.apple.TimeMachine.2018-03-23-083810@/dev/disk1s1 975210568 348612592 602865928 37% 1755978 9223372036853019829 0% /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/site-test-mbp01/2018-03-23-083810/Macintosh HD
//me@file-nasuni/abc 2147409920 227552 2147182368 1% 113774 1073591184 0% /Volumes/abc
To target the Nasuni share "abc"
smbutil statshares -m /Volumes/abc/|grep VERSION|awk '{print $2}
The command shows I'm negotiated a SMB_3.02 connection to that storage appliance share.
You can just use a network sniffer like Wireshark, filter as smb||smb2
and see in the negotiate response
the dialect that the server chosen.
This is an example how smbutil statshares -a
looks like on MacOS 10.15.4:
~ $ smbutil statshares -a
==================================================================================================
SHARE ATTRIBUTE TYPE VALUE
==================================================================================================
SomeShareName
SERVER_NAME MYSERVER._smb._tcp.local
USER_ID 502
SMB_NEGOTIATE SMBV_NEG_SMB1_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB2_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB3_ENABLED
SMB_VERSION SMB_3.02
SMB_SHARE_TYPE DISK
SIGNING_SUPPORTED TRUE
EXTENDED_SECURITY_SUPPORTED TRUE
LARGE_FILE_SUPPORTED TRUE
OS_X_SERVER TRUE
DFS_SUPPORTED TRUE
FILE_LEASING_SUPPORTED TRUE
MULTI_CREDIT_SUPPORTED TRUE
ENCRYPTION_SUPPORTED TRUE
ENCRYPTION_REQUIRED TRUE
--------------------------------------------------------------------------------------------------