To access the samba share, please pay attention to:

  1. You had to create a system user with the same username. In this case, please issue the following command: useradd -s /sbin/nologin benjamin
  2. If you are using a SELINUX-enabled system (eg: CentOS), try to temporarily disable it issuing setenforce 0

EDIT: as the problem persists, try the following:

  1. maybe your Windows host is prepending your username with the wrong domain name. From the Windows machine, try to login using localhost\benjamin as the username
  2. issue pdbedit -L and check if user benjamin is listed. If so, set a trivial password (you can change it later) using smbpasswd benjamin
  3. if user benjamin is not listed, try to recreate it issuing smbpasswd -a benjamin
  4. if it does not work, delete the passwd file (it is named passwd.tdb; for reference, in a CentOS 6.x system it is found under /var/lib/samba/private/). Then, recreate your user issuing smbpasswd -a benjamin
  5. if it still not working, try to use the root account issuing smbpasswd -a root and check if you can login using the root user. Note: this is only a try. After having done with it, you must delete root's entry issuing smbpasswd -x root
  6. Your last resort is to increase the verbosity of logging and see if you can find clues there. For authentication attempts, edit or add the following line on your smb.conf log level = 2 winbind:5, check the logs with something like tail -f /var/log/samba/log* and try to login.
Answer from shodanshok on serverfault.com
🌐
Microsoft Learn
learn.microsoft.com › en-us › troubleshoot › windows-client › networking › access-denied-access-smb-file-share
Access Denied when you access Server Message Block (SMB) file share - Windows Client | Microsoft Learn
This issue occurs in the following ... or Windows Server 2003. This issue occurs because the target folder on the SMB share is missing the SYNCHRONIZE access control entries....
Top answer
1 of 7
14

To access the samba share, please pay attention to:

  1. You had to create a system user with the same username. In this case, please issue the following command: useradd -s /sbin/nologin benjamin
  2. If you are using a SELINUX-enabled system (eg: CentOS), try to temporarily disable it issuing setenforce 0

EDIT: as the problem persists, try the following:

  1. maybe your Windows host is prepending your username with the wrong domain name. From the Windows machine, try to login using localhost\benjamin as the username
  2. issue pdbedit -L and check if user benjamin is listed. If so, set a trivial password (you can change it later) using smbpasswd benjamin
  3. if user benjamin is not listed, try to recreate it issuing smbpasswd -a benjamin
  4. if it does not work, delete the passwd file (it is named passwd.tdb; for reference, in a CentOS 6.x system it is found under /var/lib/samba/private/). Then, recreate your user issuing smbpasswd -a benjamin
  5. if it still not working, try to use the root account issuing smbpasswd -a root and check if you can login using the root user. Note: this is only a try. After having done with it, you must delete root's entry issuing smbpasswd -x root
  6. Your last resort is to increase the verbosity of logging and see if you can find clues there. For authentication attempts, edit or add the following line on your smb.conf log level = 2 winbind:5, check the logs with something like tail -f /var/log/samba/log* and try to login.
2 of 7
12

It is possible you need to add the user in question to your smb service in linux

sudo smbpasswd -a myuser
Top answer
1 of 2
4

Here are some good troubleshooting steps, shamelessly copied from ServerFault:

  1. Maybe your Windows host is prepending your username with the wrong domain name. From the Windows machine, try to login using localhost\simon as the username
  2. Issue sudo pdbedit -L (must run as root) and check if user simon is listed. If so, set a trivial password (you can change it later) using smbpasswd simon
  3. If user simon is not listed, try to recreate it issuing smbpasswd -a simon
  4. If it does not work, delete the passwd file (it is named passwd.tdb; for reference, it is found under /var/lib/samba/private/). Then, recreate your user issuing smbpasswd -a simon
  5. If it still not working, try to use the root account issuing smbpasswd -a root and check if you can login using the root user. Note: this is only a try. After having done with it, you must delete root's entry issuing smbpasswd -x root
  6. Your last resort is to increase the verbosity of logging and see if you can find clues there. For authentication attempts, edit or add the following line on your smb.conf: log level = 2 winbind:5, check the logs with something like tail -f /var/log/samba/log* and try to login.

Hope some of it helps.

2 of 2
3

I had the same issue and finale found a solution as mentioned here.

AppArmor and Samba may interfere each other after updates or not being properly configured. The suggested solution is to activate complaint-mode for AppArmor's smbd:

sudo aa-complain /etc/apparmor.d/usr.sbin.smbd

However you could also add Site-specific additions in /etc/apparmor.d/local/usr.sbin.smbd to get access.

🌐
Reddit
reddit.com › r/linuxquestions › samba share "access denied" on windows 10
r/linuxquestions on Reddit: Samba share "Access Denied" on Windows 10
August 29, 2020 -

Beating my head against the wall on this- I'm trying to set up a Samba share on a RPi and for whatever reason when I try to access it from Windows I get "access is denied". When I purposely try a wrong password I get a "username or password is incorrect"- so I know it's recognizing that the password is correct, just denies access for some reason.

My testparm -s output (Trying to access Passport):

# Global parameters
[global]
        log file = /var/log/samba/log.%m
        logging = file
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        server role = standalone server
        unix password sync = Yes
        usershare allow guests = Yes
        idmap config * : backend = tdb
        create mask = 0700
        directory mask = 0700
        valid users = %S


[printers]
        browseable = No
        comment = All Printers
        path = /var/spool/samba
        printable = Yes


[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers


[Passport]
        comment = Passport
        guest ok = Yes
        path = /mnt/Passport
        read only = No
Top answer
1 of 2
1

For Fedora 25, I am not familiar with fedora version numbers but I am with RHEL/Centos 7.x If you have selinux enabled by default, you might try as root setenforce 0 to temporarily put selinux into permissive mode until next reboot, see if this allows samba access to work. If so then it's a selinux problem, and in RHEL/Centos there is etc/samba/smb.conf.example which explains the samba related selinux commands needed to allow samba shares to work with selinux set to enforcing.

For your version of fedora, I would work off the /etc/samba/smb.conf.example.

for reference here is my working smb.conf from an older version of samba showing what i believe is the minimum required to get it to work. If you go too restrictive with settings then you can prevent a successful connection so sometimes it's best to not specify which generally means allow for all.

In your [myshare] take out allow hosts and valid users. Once samba working then consider adding restrictive measures like these as necessary.

[global]
#       min protocol = SMB1 needed for winxp
        min protocol = SMB1
#       max protocol SMB2 needed to work with win10, unspecified for this older version of samba is smb1.
        max protocol = SMB2 
        security = user
        passdb backend = tdbsam
#       map to guest = never prevents popup option, bad user allows popup in windows
        map to guest = Bad User

[data]
    path = /data
    read only = No
#   guest ok = no
#   create mask = 660
#   directory mask = 770

with guest ok = no, and map to guest bad user, will allow popup in windows giving anyone a chance to enter correct linux username and pw. map to guest never prevents popup, meaning the username of the windows user has to be the same as a valid local user in linux, per security=user. You likely do not need min/max protocol specified, I do in samba version 3.6. I don't know what verion of samba u have in fedora 25, if it's samba 3.x then try specifying the min/max protocol.

don't forget to do smbpasswd -a <username on your linux system.

2 of 2
0

I have a system that allows WinXP and Win7 to access samba as guests. A few entries that may help are:

[global]
security = user
null passwords = yes
map to guest = Bad Password
guest ok = Yes

I am using wide open shares on a trusted lan.

Top answer
1 of 3
1

If during the time that the replacement router was used, the Windows 10 computers have had some error in the credentials used, the first step should be to clean out the stored credentials.

Deleting Windows credentials is done in Control Panel > User Accounts > Credential Manager > Manage your credentials.

After the old credentials are cleaned out, you could again login to the network shares, to see if they now work as well as before.

If this doesn't help, then this is an error in Windows 10 that was introduced by some Microsoft update.

You could report the problem to Microsoft via the Feedback Hub, while for the present use the same password for server and clients. This is not an ideal situation, but it will work until a better solution is found.

2 of 3
0

This Microsoft document describes the issue:

Guest access in SMB2 and SMB3 disabled by default in Windows

If you want to enable insecure guest access, you can configure the following Group Policy settings:

Open the Local Group Policy Editor (gpedit.msc). In the console tree, select Computer Configuration > Administrative Templates > Network > Lanman Workstation. For the setting, right-click Enable insecure guest logons and select Edit. Select Enabled and select OK.

To set the value without using group policy, set the following following DWORD registry value to 1 (insecure guest auth enabled) or 0 (insecure guest auth disabled):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters AllowInsecureGuestAuth

This helped me fix an issue where mapped drives would'nt reconnect after restarting Windows 10 machines.

🌐
Reddit
reddit.com › r/raspberry_pi › help with samba share and windows 10 - "access is denied" but can access home directory.
r/raspberry_pi on Reddit: Help with Samba share and Windows 10 - "Access is denied" but can access home directory.
October 3, 2015 -

SOLVED

Steps in the end

Been breaking my head over setting up samba on my RPi2. I got my Pi last week and I set it up with no issues and then I had to reflash the SD card and start from scratch and I forgot to keep note of the steps and settings(my bad for not taking a backup, I know)

So I am facing an "Access is denied" error when trying to access from "Network" in Windows 10. I have tried with modifying group policy settings too but still the same. This is the samba.conf file :pastebin

As stated in the title, I can access the home directory, create files and folders there but as mentioned in the conf file, the other share usb is just stuck at enter password screen which I enter right every time. It just says "Access is denied."

It is a usb of ext4 format mounted at /mnt/usbd automounted at reboot.

It would be very helpful and would appreciate it if someone could guide me with what I am doing wrong.

Steps

  1. I purged samba and samba-common completely and removed the conf file too.

  2. Install samba and samba-common-bin and samba won't run as there's no conf file so copy smb.conf from usr/share/samba/smb.conf

  3. Now this is my new share file.pastebin Changes made:
    wins support = yes
    encrypt passwords = yes
    added the share in the end as opposed to in the middle of the file from before.

  4. Tested with smbtree and smbclient -L hostname

I sat up and read the samba docs for some time and started on the troubleshooting docs and tried step by step which helped me solve it. link

Thanks to everyone who tried to help me.

🌐
Reddit
reddit.com › r/selfhosted › can't access linux samba share from windows machine
r/selfhosted on Reddit: Can't access linux samba share from windows machine
January 4, 2024 -

[EDIT] I got the SAMBA share to work. My issue was the directory I was trying to share was owned by my Paperless Docker container. I kept playing around with the permissions but nothing worked getting Windows to access this volume.

What I have done so far:

  • Installed samba service on Ubuntu Server 20.04 using apt-get install samba

  • Set the ownership of the directory to myUser(same as SMB user) using chown myUser:nogroup /directory

  • Set permissions to everyone with chmod 770 /directory

  • Created a samba user with smbpasswd -a myUser

  • Added the share to the smb.conf like this:

[Folder Name]

path = /directory

read only = no

valid users = myUser

  • Set the SMB protocol to:

server min protocol = SMB2

server max protocol = SMB3

(Windows is using 3.1.1)

  • Restarted the Samba service with service smbd restart

After all this, I went to the windows machine, browsed the share with \\server_name\Folder Name and found it, tried to open it, and got an error saying "You do not have permission to access \\server_name\Folder Name. Contact your network administrator to request access.

I also tried mounting the shared folder via net use on the Windows machine with net use Z: \\\\server_name\Folder Name /User:myUser

The drive is mounted successfully but again, when I go to open it, I get the permission error.

I checked my windows firewall and made sure I allowed the workgroup on the samba share.

I'm not sure what else to try at this point.

The smb logs show a successful connection from the windows IP with no further detail but on the Windows side I get the permission error. Here's a portion of the logs:

root@ubuntu-server:/var/snap/docker/common/var-lib-docker/volumes/paperless_consume/_data# sudo nano /etc/samba/smb.conf

root@ubuntu-server:/var/snap/docker/common/var-lib-docker/volumes/paperless_consume/_data# sudo service smbd restart

root@ubuntu-server:/var/snap/docker/common/var-lib-docker/volumes/paperless_consume/_data# sudo tail -f /var/log/samba/log.smbd

[2024/01/04 06:38:09.805277, 4] ../../source3/smbd/sec_ctx.c:317(set_sec_ctx_internal)

setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1

[2024/01/04 06:38:09.805324, 4] ../../source3/smbd/sec_ctx.c:443(pop_sec_ctx)

pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0

[2024/01/04 06:38:09.806432, 3] ../../source3/printing/queue_process.c:359(start_background_queue)

start_background_queue: Starting background LPQ thread

[2024/01/04 06:38:09.854010, 1] ../../source3/printing/printer_list.c:255(printer_list_get_last_refresh)

Failed to fetch record!

[2024/01/04 06:38:09.854076, 2] ../../source3/smbd/server.c:1364(smbd_parent_loop)

waiting for connections

[2024/01/04 06:38:30.713250, 2] ../../source3/lib/tallocmsg.c:84(register_msg_pool_usage)

Registered MSG_REQ_POOL_USAGE

[2024/01/04 06:38:30.713581, 3] ../../lib/util/access.c:372(allow_access)

Allowed connection from 192.168.0.107 (192.168.0.107)

At this point I don't know what else to try, and Googling and AI just keep telling me to try the same things I've already tried.

Could someone here help?

🌐
TrueNAS Community
truenas.com › forums › archives › general help › general
SMB Share Access Denied on One Computer Windows 10 | TrueNAS Community
January 27, 2022 - I have even tested a known working user and still get "Access Denied". So far I have: -Disabled SMB 1 -Cleared all Windows Credentials. -Added prefix to the username: NasName\username -Restarted computer -Made sure the widows user accounts are local. The computers were originally setup with a single microsoft account (non local) using different pins for all the computers which gave me problems accessing the shares until I converted them to local accounts. Here is what shows up in the samba logs: ../../source3/smbd/service.c:169(chdir_current_service) chdir_current_service: vfs_ChDir(/mnt/share/employees) failed: Permission denied.
Find elsewhere
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
Mint 19 Samba shares 'Access is denied' from Windows 10 (works in Mint 18) [SOLVED] - Linux Mint Forums
Linux Mint Forums · Welcome to the Linux Mint support forums · Skip to content · Quick links · Unanswered topics · Active topics · Search · Login · Register · Board index
🌐
Rockstor
forum.rockstor.com › troubleshooting
Samba Shares in Windows - Troubleshooting - Rockstor Community Forum
October 17, 2023 - Hello, I’ve just returned to Rockstor after many years and made it smoothly through the install process for the current stable release (on a Dell T20, SSD boot disk with 2 pooled HDDs), feeling very good…and then hit Samba access issues in Windows 10 where I’m now entirely out of ideas ...
🌐
OpenWrt Forum
forum.openwrt.org › installing and using openwrt
Samba Share Access Denied on Windows 10 and Android - Installing and Using OpenWrt - OpenWrt Forum
March 15, 2023 - I've been bashing my head against this for HOURS searching every thread on every site I can find, but so far nothing that has worked for other people has worked for me. I am trying to setup up a network share on a USB drive with Samba4 on my router. I followed the instructions on this page https://openwrt.org/docs/guide-user/services/nas/cifs.server, step by step, very carefully, twice.
🌐
Red Hat
access.redhat.com › solutions › 6168772
Access Denied to samba shared file from a Windows command prompt. - Red Hat Customer Portal
June 13, 2024 - Same share can be accessed locally using smbclientand in file explorer, but gives below error while connecting using command prompt. C:\Windows\system32>CMD /C START W:\example\test.pdf Access is denied. ... A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
SAMBA permission denied from Windows - Linux Mint Forums
Have you created the user 'bpenven' as a Unix and Samba user ? Lets take your 'Jellyfin' share, line by line, ignoring the 'path': force user = bpenven This means that every authenticated user that connects becomes 'bpenven' guest ok = Yes This means that unknown, unauthenticated users can access the share as the user 'nobody' read only = No This means the share is readable and writeable valid users = bpenven This means that the only user that can connect is 'bpenven', so this stops guest access in its tracks, 'nobody' will not be allowed.
🌐
Windows OS Hub
woshub.com › cannot-access-smb-network-shares-windows-10-1709
Can’t Access Shared Folders or Map Network Drives from Windows 10 and 11 | Windows OS Hub
March 16, 2024 - The error message clearly shows that the network shared folder only supports the SMBv1 client access protocol. In this case, you should try to reconfigure the remote SMB device to use at least SMBv2 (the correct and safe way).
🌐
Microsoft Learn
learn.microsoft.com › en-us › troubleshoot › windows-client › networking › cannot-access-shared-folder-file-explorer
Can't access shared folders from File Explorer - Windows Client | Microsoft Learn
... For more information, see Net use. Turn on the SMB 1.0 support feature from Control Panel by following these steps: Open Control Panel. Select Programs > Programs and Features > Turn Windows features on or off > SMB 1.0/CIFS File Sharing Support.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
Windows 10/11 Samba file sharing - access denied [sort of solved but observations appreciated] - Linux Mint Forums
September 9, 2025 - Hi, The tutorial link is at https://www.youtube.com/watch?v=qo1CIuyoCeA I've solved the "how to access from Win 11" query from some further web searching - I had to allow configure the Win 11 machine to allow insecure connections, and I can now access other machines on the network. I failed to mention addition of the winaccess user to the samba password database - I had done that already, thanks "If it works for Win11 it should work for Win10..." That's what I thought which is why I am flummoxed hopefully this screenshot shows you what I've done ... The usershare info just gives info about a different folder which I set up first, then shared, no info about the folder I'm now trying to share Hope this is enough
🌐
Quest Support
support.quest.com › kb › 4295455 › unable-to-access-samba-share-from-windows-10-client
Unable to access Samba share from Windows 10 client. (4295455)
May 7, 2023 - Per Microsoft's article from Guest access in SMB2 disabled by default in Windows 10, Windows Server 2016 version 1709, and Windows Server 2019: "This change in default behavior is by design and is recommended by Microsoft for security. A malicious computer that impersonates a legitimate file ...
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › troubleshooting
[SOLVED] Simple Samba Share Access Denied - Raspberry Pi Forums
October 17, 2021 - If the later, remove the lines, create a Unix user with the name you want to connect with (probably your name), now create the Samba user 'smbpasswd -a THE_UNIX_USERNAME'. restart Samba and connect from windows as the user you just created, just one proviso, you should use the same password ...