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.
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
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.
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.
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 = NoSOLVED
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
-
I purged samba and samba-common completely and removed the conf file too.
-
Install samba and samba-common-bin and samba won't run as there's no conf file so copy
smb.conffromusr/share/samba/smb.conf -
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. -
Tested with
smbtreeandsmbclient -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.