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.

Answer from Artur Meinild on askubuntu.com
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.

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
Discussions

Unable to connect to my SMB share - permission denied
I set up a samba server on my laptop for family members. The setup is like this: Added a separate user for share called shareuser with uid=250 Added the user to the smb database, password set up: sudo smbpasswd -a shareuser Created a group for the smb share and added the user to it: groups ... More on discussion.fedoraproject.org
🌐 discussion.fedoraproject.org
17
0
September 3, 2022
SMB Permission Denied from Linux
Hi. I have TrueNAS Scale deployed. I hate it because it is nearly impossible to manage. It is nearly impossible to give access to it without errors and hours and hours of troubleshooting. I have spent, spread over months, literally over a man-day troubleshooting because the documentation sucks, ... More on forums.truenas.com
🌐 forums.truenas.com
0
0
September 11, 2024
Permission denied to create files on Samba shared folder mounted using CIFS - Unix & Linux Stack Exchange
I have two ubuntu (lubuntu 20.10) machines. On one of the machines, I created a folder and shared it using samba. My entry in /etc/samba/smb.conf looks like this [MyShare] comment = NO COMMENTS ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
June 19, 2021
SMB sharing, access denied
Did you set the pass using smbpasswd? SMB can't use the unix auth system More on reddit.com
🌐 r/linuxquestions
7
1
October 19, 2021
🌐
Reddit
reddit.com › r/linuxquestions › samba not working on brand new ubuntu install after following the ubuntu tutorials guide: permission denied
r/linuxquestions on Reddit: Samba not working on brand new Ubuntu install after following the Ubuntu tutorials guide: Permission Denied
October 19, 2024 -

Hey! Trying to get Samba working on a bare metal, stock Ubuntu 24.04 machine. I'm able to connect to it from my Windows machine and read files, but if I try to write to it, it returns "Permission Denied". All the solutions I've found online involved problems with VM's or some other complicated setup, but this is as simple as it gets and I still can't get it up (user has been replaced, as it contains my full name)

[backups]
   comment = primary file storage
   path = /home/user/Files
   read only = no
   browsable = yes
🌐
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 - Re: Simple Samba Share Access Denied Report this postQuote Tue Jan 10, 2017 3:39 pm Code: Select all pi@th3b0x:~ $ sudo getfacl /media/pi getfacl: Removing leading '/' from absolute path names # file: media/pi # owner: root # group: root user::rwx user:pi:r-x group::--- mask::r-x other::--- So /media/pi needs to have other access for Read Execute, correct?
🌐
Fedora Discussion
discussion.fedoraproject.org › ask fedora
Unable to connect to my SMB share - permission denied - Fedora Discussion
September 3, 2022 - I set up a samba server on my laptop for family members. The setup is like this: Added a separate user for share called shareuser with uid=250 Added the user to the smb database, password set up: sudo smbpasswd -a shareuser Created a group for the smb share and added the user to it: groups shareuser shareuser : shareuser smbgroup1 Set the SELinux context properly, changed group ownership to smbgroup1 (recursive): drwxrwx---. 6 my...
🌐
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.
🌐
Ubuntu
ubuntu.com › server › docs › how-to › samba › share-access-controls
Share access controls - Ubuntu Server documentation
2 weeks ago - Configure Samba share access controls by managing user authentication, permissions, and security options for shared directories.
Find elsewhere
🌐
TrueNAS Community
forums.truenas.com › truenas general
SMB Permission Denied from Linux - TrueNAS General - TrueNAS Community Forums
September 11, 2024 - Hi. I have TrueNAS Scale deployed. I hate it because it is nearly impossible to manage. It is nearly impossible to give access to it without errors and hours and hours of troubleshooting. I have spent, spread over mo…
🌐
Reddit
reddit.com › r/linuxquestions › smb sharing, access denied
r/linuxquestions on Reddit: SMB sharing, access denied
October 19, 2021 -

Newish Ubutnu 20 LTS server. I created share, but can't seem to figure out why I can't access that share. It shows up in network explorer on windows, but always a password denied.

[downloads2]
path = /mnt/disk2/downloads
valid users = @media
browsable = yes
writable = yes
read only = no
create mask = 0775
directory mask = 0775

/etc/password

media:x:1003:1004:,,,:/home/media:/bin/bash

user:media

pass: 1234

(I know it's short and insecure)

ls -alh /mnt/disk2/

drwxrwxrwx  5 root root  4096 Oct 17 17:21 ./
drwxr-xr-x 12 root root  4096 Oct 17 11:23 ../
drwxrwsr-x  2 media media  4096 Oct 17 17:21 downloads/

Not sure what I'm missing.

Edit:

Needed to set smbpasswd

🌐
Google Groups
groups.google.com › d › topic › linux.samba › rcs1ELcVUj4
[Samba] Access denied when associating a driver with a printer
November 4, 2013 - Hi, I'm trying to get point & print ... a 4.0.10 Samba server (using the sernet packages if that's relevant). I have the printer itself setup and I've uploaded the driver, but associating the uploaded driver with the printer causes Windows to give an error: "Printer settings could not be saved. Access is denied"...
🌐
Stack Overflow
stackoverflow.com › questions › 70920783 › windows-10-unable-to-connect-to-ubuntu-20-04-3-samba-server-0x80004005-unspecif
Windows 10 unable to connect to Ubuntu 20.04.3 Samba ...
I checked the log by using systemctl status smbd and results in multiple lines of session closed for user samba-guest. The timing seems consistent with me acessing the share via smbclient. The ubuntu server is also running OpenVPN server. The OpenVPN server uses 10.8.0.0/24 subnet and is assigned 10.8.0.1 ip address. If I connect to the OpenVPN server using the same Windows 10 computer and then access the samba share by typing \\10.8.0.1 in the file explorer, I can see the folder bakro listed.
🌐
Ubuntu.ru
forum.ubuntu.ru › index.php
samba permission denied - Ubuntu.ru
samba permission denied · XHTML RSS Мбильная версия · SMF 2.0.18 | SMF © 2011, Simple Machines · Страница сгенерирована за 0.057 секунд. Запросов: 24. Сайт · Об Ubuntu · Скачать Ubuntu · Семейство Ubuntu ·
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
[SOLVED] SAMBA - Access denied to smb://workgroup/ / Networking, Server, and Protection / Arch Linux Forums
November 9, 2009 - Add the same user as above using smbpasswd -a Start SAMBA · It still prompts for a password and eventually denies access.
🌐
Raspberry Pi
raspberrypi.org › forums › viewtopic.php
samba server gives me a permission denied error when connecting - Raspberry Pi Forums
May 4, 2020 - Even if you did set 'guest ok = yes' it wouldn't work because you have also set 'valid users = @users' and you cannot use 'valid users' with 'guest ok = yes' So, how do you want to connect to the share, with a username & password, or guest access ? ... i would be nice to use it with a password so yes that is the end goal. i was just having trouble getting it to work and so i fallowed a lot of tutorials and now my config is a mess ... [global] log file = /var/log/samba/log.%m logging = file max log size = 1000 panic action = /usr/share/samba/panic-action %d security = USER unix password sync =
🌐
Reddit
reddit.com › r/homeserver › "destination folder access denied" - samba share?
r/HomeServer on Reddit: "Destination Folder Access Denied" - Samba Share?
March 13, 2016 -

I have been trying for 2 days to get write access to my ubuntu server from a windows account. I am using webmin and samba, but have tried several different edits to smb.conf based on what I've found searching the internet. I cannot seem to get write access. My current smb.conf has the following lines in it:

path = /home/dad/dadshare

read only = no

writeable = yes

create mode = 0777

browseable = yes

guest ok = yes

user dad is the owner of /home/dad/dadshare

Any help would be appreciated

🌐
Unraid
forums.unraid.net › home › unraid os support › general support › write permission denied for smb share
Write permission denied for SMB share - General Support - Unraid
August 29, 2021 - I am unable to write to a public SMB share (share is exported and public). I am able to read from the share. I am authenticating as a guest. The output of smbstatus while authenticated is: Samba version 4.11.4 PID Username Group Machine Protocol Version Encryption Signing ------------------------...