Here are some good troubleshooting steps, shamelessly copied from ServerFault:
- Maybe your Windows host is prepending your username with the wrong domain name. From the Windows machine, try to login using
localhost\simonas the username - Issue
sudo pdbedit -L(must run as root) and check if usersimonis listed. If so, set a trivial password (you can change it later) usingsmbpasswd simon - If user
simonis not listed, try to recreate it issuingsmbpasswd -a simon - 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 issuingsmbpasswd -a simon - If it still not working, try to use the root account issuing
smbpasswd -a rootand 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 issuingsmbpasswd -x root - 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 liketail -f /var/log/samba/log*and try to login.
Hope some of it helps.
Answer from Artur Meinild on askubuntu.comHere are some good troubleshooting steps, shamelessly copied from ServerFault:
- Maybe your Windows host is prepending your username with the wrong domain name. From the Windows machine, try to login using
localhost\simonas the username - Issue
sudo pdbedit -L(must run as root) and check if usersimonis listed. If so, set a trivial password (you can change it later) usingsmbpasswd simon - If user
simonis not listed, try to recreate it issuingsmbpasswd -a simon - 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 issuingsmbpasswd -a simon - If it still not working, try to use the root account issuing
smbpasswd -a rootand 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 issuingsmbpasswd -x root - 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 liketail -f /var/log/samba/log*and try to login.
Hope some of it helps.
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.
To access the samba share, please pay attention to:
- You had to create a system user with the same username. In this case, please issue the following command:
useradd -s /sbin/nologin benjamin - 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:
- maybe your Windows host is prepending your username with the wrong domain name. From the Windows machine, try to login using
localhost\benjaminas the username - issue
pdbedit -Land check if userbenjaminis listed. If so, set a trivial password (you can change it later) usingsmbpasswd benjamin - if user
benjaminis not listed, try to recreate it issuingsmbpasswd -a benjamin - 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 issuingsmbpasswd -a benjamin - if it still not working, try to use the root account issuing
smbpasswd -a rootand 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 issuingsmbpasswd -x root - 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 liketail -f /var/log/samba/log*and try to login.
It is possible you need to add the user in question to your smb service in linux
sudo smbpasswd -a myuser
Unable to connect to my SMB share - permission denied
SMB Permission Denied from Linux
Permission denied to create files on Samba shared folder mounted using CIFS - Unix & Linux Stack Exchange
SMB sharing, access denied
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
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
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