I want to share a folder on our Ubuntu 20.04 Linux server to our Windows 10 Pro clients in the same network via Samba. So I installed Samba 4.11.6 on the server and created this (minimal) smb.conf configuration:

   workgroup = WORKGROUP
   server string = File server (Samba, Ubuntu)
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   panic action = /usr/share/samba/panic-action %d
   security = user
   encrypt passwords = true
   passdb backend = tdbsam
   server role = standalone server
   obey pam restrictions = yes
   unix password sync = no
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   usershare allow guests = no

    comment = Data Share
    path = /data/Share
    read only = no
    browsable = yes

Then I created a Samba user for my existing user mfb on the Linux server:

sudo smbpasswd -a mfb

Then I (re-)started Samba:

sudo service smbd restart

Now I can correctly connect via smbclient from the server itself, and also mount that Data share on a Windows 10 machine using the command line:

net use D: \\LinuxServer\Data /PERSISTENT:YES

After providing mfb as user name and the new password from smbpasswd that net use command works fine, the Samba share is correctly mapped to drive D: on the Windows client.

However, there are two issues with this setup:

  1. After rebooting the Windows client the share is not mounted any more, even though I have used the /PERSISTENT:YES switch; and
  2. When I don't use the net use command on Windows, but instead want to map the network share directly from the Windows Explorer, providing alternative credentials (not my Windows user, but the mfb user from Linux/Samba), then it keeps asking me for the password (which works fine via net use).

Any ideas what I am missing here?

  • Don’t worry you are not the only one. For me, when done through explorer it crashes. And I think it is related to the fact nfs was the only thing installed during some time and not samba. – vigilian Apr 2 at 15:11

Your Answer

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

Browse other questions tagged or ask your own question.