I have two networked FreeBSD 11.1 servers, both installed with Samba 4.6.x. No issues with Samba, which browses nicely from any Windows client, but I cannot seem to find the syntax to mount samba using CLI from one to the other of the servers (or indeed from one on itself).

Both servers use the same remoteuser + password to access Samba shares. The servers are standalone and use their own users/groups for authentication/permissions; there's no AD.


smbclient \\\\servername\\myfiles -U servername\\remoteuser
smbclient '\\servername\myfiles' -U servername\\remoteuser
  (they're equivalent)

Doesn't work (taken from history):

mount_smbfs -I serverIP //remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs -I servername //remoteuser@servername/myfiles ~/mountpoint    
smbutil -v login //remoteuser@servername/myfiles    
mount_smbfs -I smbclient \\\\servername\\myfiles -U servername\\remoteuser    
mount_smbfs -U servername\\remoteuser \\\\servername\\Usr_files ~/mountpoint    
mount_smbfs -U servername\\remoteuser //remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs //remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs //\\servername\\remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs //\\\\servername\\remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs //servername/remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs -I serverIP //servername/remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs //remoteuser@servername.FQDN/myfiles ~/mountpoint    
mount_smbfs //remoteuser@servername/myfiles ~/mountpoint    
mount -t smbfs //remoteuser:remotepassword@servername/myfiles ~/mountpoint    
mount -t smbfs //remoteuser@servername/myfiles ~/mountpoint    
mount -t smbfs \\\\remoteuser@servername\\myfiles ~/mountpoint    
mount -t smbfs remoteuser@servername/myfiles ~/mountpoint    
mount -t smbfs //remoteuser@servername/myfiles ~/mountpoint    
mount -t smbfs //remoteuser@serverIP/myfiles ~/mountpoint    
mount_smbfs -I servername //remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs -I servername -U \\\\servername\\remoteuser //remoteuser@servername/myfiles ~/mountpoint    
mount_smbfs -I servername -U \\\\servername\\remoteuser //servername/myfiles ~/mountpoint    

You get the idea :) I've tried troubleshooting what it's expecting vs. what I'm giving, in the remote server's smbd log, but I still can't seem to find the command needed.

The error message is "permission denied", or in the remote log, a mix of NT_STATUS_NO_SUCH_USER ("your syntax for the user/system name was wrong"), NT_STATUS_NOT_FOUND ("your syntax for the share or something else was wrong")and NT_STATUS_ACCESS_DENIED ("your syntax for credentials was wrong"). As the first command above doee work, it's clear the issue is one of using incorrect syntax/args, and not an actual permissions, mission resource, or config issue.

What am I fundamentally misunderstanding about Samba's CLI syntax, here, and what is the correct command?


... works

mount_smbfs -I -U someuser -W someworkgroup //someuser@ /mnt/somemountname
  • I do not get it – Pierre.Vriens Sep 18 '18 at 18:38
  • Is it the addition of the -W that made the difference? Some explanation would be appreciated. – Jeff Schaller Sep 18 '18 at 19:35
  • When I had this issue, the -W helped me because it needed to know the domain/workgroup of the server you are joining. Once I added a domain, the client knew which server it should be connecting to – PolkaRon Jul 23 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.