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 //[email protected]/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?


2 Answers 2


mount_smbfs doesn't work properly with smbv2 and beyond. The only solution I found is to change some settings on the samba server in global section of smb.conf

    client ntlmv2 auth = no
    ntlm auth = yes

setting the above let me mount my samba share on FreeBSD host with mount_smbfs command and write to the share

mount_smbfs -I -U someuser //someuser@samba4/someshare /sambad01

and test_parm on the samba server shows the following:

root@samba:/ # testparm
Load smb config files from /usr/local/etc/smb4.conf
Loaded services file OK.

Press enter to see a dump of your service definitions

# Global parameters
        client NTLMv2 auth = No
        log file = /var/log/samba4/%m
        map to guest = Bad User
        netbios name = SAMBA4
        ntlm auth = ntlmv1-permitted
        idmap config * : backend = tdb

smbstatus (NT1 for mount_smbfs and smb3_11 for my windows host):

root@samba:/ # smbstatus

Samba version 4.10.11
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
1200    someuser   someuser   d04 (ipv4:                 NT1               -                    -
13014   someuser   someuser (ipv4:      SMB3_11           -                    partial(AES-128-CMAC)

... works

mount_smbfs -I -U someuser -W someworkgroup //[email protected]/somesharename /mnt/somemountname
  • I do not get it Commented Sep 18, 2018 at 18:38
  • Is it the addition of the -W that made the difference? Some explanation would be appreciated.
    – Jeff Schaller
    Commented Sep 18, 2018 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
    Commented Jul 23, 2019 at 21:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .