Samba Windows Share error: "NT_STATUS_ACCESS_DENIED" - Missing usershares
Solution 1
Change the hostname to something less than 15 characters.
Write this: netbios name = somethinglessthan15chars
under the globals section in /etc/samba/smb.conf
.
Solution 2
You need to use smbpasswd
to add the user to the smb database and set their password.
Related videos on Youtube
ForceMagic
Programmer, tech enthusiast and good friend all in one!
Updated on September 18, 2022Comments
-
ForceMagic over 1 year
EDIT: The problem actually turned out to be a missing file error. Still can't fix that :/ The missing file is
/var/lib/samba/usershares/public
EDIT2: Can't even access the server itself. Googled and found the answer. It's down there /
Basically, title says it all, but here's my
smb.conf
(without comments):[global] server string = %h server (Samba, Ubuntu) server role = standalone server map to guest = Bad User obey pam restrictions = Yes pam password change = Yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . unix password sync = Yes syslog = 0 log file = /var/log/samba/log.%m max log size = 1000 dns proxy = No usershare allow guests = Yes panic action = /usr/share/samba/panic-action %d idmap config * : backend = tdb [printers] comment = All Printers path = /var/spool/samba create mask = 0700 printable = Yes print ok = Yes browseable = No [print$] comment = Printer Drivers path = /var/lib/samba/printers [public] path = /home/public/public valid users = public read only = No
And here's my directory info:
total 36K 527845 drwx--x--x 3 public public 4.0K Dec 3 14:45 . 524289 drwxr-xr-x 6 root root 4.0K Dec 3 13:38 .. 527847 -rw-r--r-- 1 public public 220 Dec 3 13:21 .bash_logout 527848 -rw-r--r-- 1 public public 3.7K Dec 3 13:21 .bashrc 527846 -rw-r--r-- 1 public public 8.8K Dec 3 13:21 examples.desktop 527849 -rw-r--r-- 1 public public 675 Dec 3 13:21 .profile 527429 drwxrwxrwx 2 public root 4.0K Dec 3 14:45 public
BTW, sorry, I'm a bit of a noob in Samba. Hope you'll understand.
Thanks in advance,
matemate01PS: I've done the
smbpasswd -a public
and tried my best to follow this tutorialHere's my actual error:
tree connect failed: NT_STATUS_ACCESS_DENIED
-
psusi over 8 yearsAnd how are you trying to connect?
-
ForceMagic over 8 years@psusi Using
smbclient \\\\localhost\public -U public
. It asks for password and then says that error message. Tried with Windows, using the IP address, gives Access Denied error. -
psusi over 8 yearsCheck the samba log file? also auth.log.
-
ForceMagic over 8 years@psusi It says
can't open username map /etc/samba/smbusers. No such file or directory
auth.log says:pam_unix(samba:session): session closed for user nobody
PS: Still don't know how to fix that :(
-
-
psusi over 8 years@ForceMagic, if you had, then you would not be missing /etc/samba/smbusers.
-
Fabby over 8 years@psusi: You're losing it: You're showing up on the Low Quality review queue! >:-) (+1 and voted "Looks OK")
-
ForceMagic over 8 years@psusi Alright. Completely purged and reinstalled samba. Now it says
missing /var/lib/samba/usershares/public
I executed these things, if this helps. (Though this is not the complete command-line log.) Still, the client connector says the thing declared on the main question.