How can I have Finder mount an SMB share from ssh without confirmation?
As mentioned by @klanomath, the confirmation can be disabled by following instructions on this page: https://support.apple.com/en-us/HT207112

That is, from a terminal:

sudo defaults write /Library/Preferences/com.apple.NetworkAuthorization AllowUnknownServers -bool YES


And then, to undo this change (for better security):

sudo defaults delete /Library/Preferences/com.apple.NetworkAuthorization AllowUnknownServers