27

I set up a share like this:

[global]
    security = user
    map to guest = Bad Password
    usershare allow guests = yes

[vms]
    comment = VirtualBox Virtual Machines
    path = /home/neil/VirtualBox/HardDisks
    guest ok = yes
    read only = yes

And when I access the share as myself, and type in my password, it works fine:

$ smbclient //neil-ubuntu/vms -U neil
Enter neil's password: 
Domain=[SHUTTERSTOCK] OS=[Unix] Server=[Samba 3.4.0]
smb: \>

But when I access it as guest, it doesn't work:

$ smbclient //neil-ubuntu/vms -U guest
Enter guest's password: 
Domain=[SHUTTERSTOCK] OS=[Unix] Server=[Samba 3.4.0]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

Regardless of what password I type in.

Does anyone know why?

Also, why does smbclient print such useless error messages?

Neil
  • 2,345
  • 8
  • 35
  • 44

4 Answers4

19

I recall a problem like this. I think it was caused by a directory permission somewhere in the path missing read. Check the directory perms are 755 for the path.

This error is also returned if the path does not exist.

Tahlor
  • 103
  • 1
  • 1
  • 3
user9517
  • 114,104
  • 20
  • 206
  • 289
  • You're right, that was the problem in my case. If you're getting the same useless error message as me, though, it could be some other problem as well. – Neil Apr 30 '10 at 16:56
  • 9
    another possible reason: the share definition points to a non-existent directory. – Felix Schwarz Apr 10 '13 at 18:49
  • @FelixSchwarz: Cheers, that's one to remember. – user9517 Apr 10 '13 at 18:53
  • In my case, I triggered this error through poor use of comments in the `smb.conf` file. I've since learned the hard way that comments need to be on a separate line. When configuring the folder for sharing, I added what I thought were **helpful** comments inline with many of the fields. Unfortunately they were not interpreted as comments but as part of the value... – Jet Blue May 21 '20 at 05:11
1

I'll just chime in here with a different problem, but same error message. If you're using Samba < 3.2, you cannot connect to Windows Server 2008 AD servers. This includes the version of Samba included in CentOS (and presumably RHEL) 5, currently Samba 3.0.23. As of August 2011, the current version of Samba is 3.6.

I used the Samba repositories for CentOS 5 hosted by Sernet at http://www.enterprisesamba.org/index.php?id=125 to install Samba 3.4 and connect to a Win 2008 server. Don't forget to install/update winbind (yum install samba3-winbind after you add the repository) and you may need to update /etc/krb5.conf (I just moved it to a /etc/krb5.conf.bak and things work fine).

I also received Got NTLMSSP neg_flags=0x62898215 frequently in the smbclient logs.

jeffcook2150
  • 225
  • 1
  • 2
  • 7
0

At the risk of raking up an old topic, the "permissions" comment is almost right. I was going mad checking things, everything looked right and it still wouldn't work.

The obvious answer : I had SElinux turned on and denying any access to the (non standard) location I was trying to share.

setenforce 0

And it suddenly works. Of course, now I will turn it back on and fix the config properly. Honest....

Max Allan
  • 305
  • 1
  • 4
  • 11
  • I'm sure you did turn it back on, right after figuring out that the files need to be changed to `samba_share_t` using `chcon -t samba_share_t /path/to/file` or similar settings documented on the selinux wiki: https://selinuxproject.org/page/SambaRecipes – Hubert Kario Aug 17 '20 at 20:12
0

try #sudo smbpasswd -a guest

just a shot there. If that doesn't work, try adding "guest' to the line "valid users" in /etc/samba/smb.conf like so,

valid users = user1, guest
chris
  • 1