tl;dr: Restarting netauthsysagent quickly resets stalled Finder connections to Samba shares. A longer-term fix may be to remove unused Kerberos values from the com.apple.smb.server.plist file.
Despite being on a stable wired ethernet link, macOS’s connection to Samba shares can be really flaky. Finder will sometimes lose its SMB connection entirely and refuse to reconnect, even though everything else on the network is working fine and you can browse or connect to Samba shares via command line.
Any signal interruption or change on the server side can cause Finder’s Samba connections to fail. If that happens, the system may enter a state where it becomes impossible to reconnect to the server without a logout or reboot.
Symptoms of the issue
- macOS can’t connect to Samba shares.
- Finder won’t connect to SMB server either by name or IP address.
- “Connecting to” dialog hangs indefinitely when connecting to the server.
- No warning or error message indicating what’s wrong.
- Disconnecting from the server and reconnecting doesn’t help.
- Restarting the remote server doesn’t help.
- Samba share browsing commands and connections work via command line, but not in Finder.
The quick fix
Running this command in the terminal kills the stalled process and immediately fixes the issue. The process restarts automatically, reconnecting any Samba shares set to load on login.
killall netauthsysagent
Why this happens
The culprit is something relating to bad state within netauthsysagent.
A little reading showed that this is a very old, unfixed issue with macOS. A lingering LocalKerberosRealm setting in /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist contributes to the inability to connect to the remote servers, resulting in the stalled “Connecting to” dialog. Systems that at one point had file sharing enabled, and/or have had major os upgrades may face this issue.
The longer-term fix
My system had that LocalKerberosRealm value. Since it’s not a file server, I deleted that file and rebooted my machine. The file regenerated, but no longer has that one value.
I’ll update this post later if it turns out that this was a long-term fix, or if I find out any more information that helps.