Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Any way to force SMB2 instead of SMB3

Running Server 5.0.13 on a 2015 Mac Mini running 10.11.3


I'm having a very weird glitch running one particular software program on client machines. The software cannot write to one particular file type (the .INI files necessary for the program to operate) but only when it tries to write the file to the OS X file server (which connects via SMB 3.0). It can write the file locally, and on an older Windows server (that connects via SMB2.1), and the program can write other files to the OS X file server - just not the .INI


Permissions don't seem to be the issue, as they're currently wide open. At this point, I'm thinking it must be something odd with SMB 3.0, or opportunistic locking. Any advice on either forcing connection at SMB2, or changing opportunistic locking would be appreciated.

Mac mini, OS X El Capitan (10.11.3), OS X Server 5.0.13

Posted on Mar 16, 2016 6:15 PM

Reply
Question marked as Best reply

Posted on Mar 17, 2016 6:52 AM

OS X now uses Apple's own SMBx implementation of SMB rather than the more common SAMBA implementation, as a result the methods and options for configuring SMB on a Mac are now different and far more limited.


If it was a Mac user having a problem connecting to a SMB server then the file in question would be ~/Library/Preferences/nsmb.conf i.e. in the users individual Preferences folder. This file does not exist as standard meaning the default settings are used, if this file is created with valid settings then it will override the default settings.


For a Mac acting as an SMB server however it is less clear what the options are, there is a preference file at /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist but Apple specifically tell you not to modify this file as it is maintained i.e. updated by Apple's own software e.g. Server.app. This means if you did modify it then likely any changes would be quickly overwritten again by Apple's own software.


The other remaining option is /etc/nsmb.conf this file also however does not exist as standard. Again if you create it it will override the default settings and override any identical options in a users own ~/Library/Preferences/nsmb.conf


I suggest doing the following in Terminal.app to read Apple's documentation on this topic.


man nsmb.conf

man smbd


My best guess would be that creating /etc/nsmb.conf on your Mac server with an option defining smb2_only might be the best approach. What is not clear is whether this only applies to using a Mac as a client or whether it will also apply to being a server.

3 replies
Question marked as Best reply

Mar 17, 2016 6:52 AM in response to honu_girl

OS X now uses Apple's own SMBx implementation of SMB rather than the more common SAMBA implementation, as a result the methods and options for configuring SMB on a Mac are now different and far more limited.


If it was a Mac user having a problem connecting to a SMB server then the file in question would be ~/Library/Preferences/nsmb.conf i.e. in the users individual Preferences folder. This file does not exist as standard meaning the default settings are used, if this file is created with valid settings then it will override the default settings.


For a Mac acting as an SMB server however it is less clear what the options are, there is a preference file at /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist but Apple specifically tell you not to modify this file as it is maintained i.e. updated by Apple's own software e.g. Server.app. This means if you did modify it then likely any changes would be quickly overwritten again by Apple's own software.


The other remaining option is /etc/nsmb.conf this file also however does not exist as standard. Again if you create it it will override the default settings and override any identical options in a users own ~/Library/Preferences/nsmb.conf


I suggest doing the following in Terminal.app to read Apple's documentation on this topic.


man nsmb.conf

man smbd


My best guess would be that creating /etc/nsmb.conf on your Mac server with an option defining smb2_only might be the best approach. What is not clear is whether this only applies to using a Mac as a client or whether it will also apply to being a server.

Mar 17, 2016 6:52 AM in response to honu_girl

We have file perm issues with our SAN. Basically our SAN doesnt like SMB 2 from our Macs, so we use SMB 1 (slower, but less corrupty...). We are moving away from this SAN shortly though.


I ensure this command is ran on all of our clients (either on the base image, deployment workflow or sent our via ARD terminal command)


sudo sh -c "echo '[default]' >> /etc/nsmb.conf; echo 'smb_neg=smb2_only' >> /etc/nsmb.conf"


this forces SMB2 on the client


you can then view the share connection with this command:

smbutil statshares -a


which shows what flavour of SMB is being used.


To remove the nsb.conf file and revert back to defaults, use this command :


rm /etc/nsmb.conf

REBOOT FOR CHANGES TO TAKE EFFECT

Mar 17, 2016 7:35 AM in response to Bosco1983

Thanks for this, it was helpful! Ideally, though, I wish there were a way to force this on the server side, especially as most of my client machines are running Windows 7. In fact, the program that is causing the issues is a Windows-only program.


Unfortunately, forcing SMB2 or SMB1 didn't solve my problem, as I'm still getting the error. I was hoping that it was SMB, but it doesn't appear to be the case. I'm really stumped by this, as it seems to be only the one file type, and only when written from this one particular (Windows-only) program.

Any way to force SMB2 instead of SMB3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.