# smbclient unable to connect to file server = PROBLEM SOLVED

## lnxmacusr

Hey everyone,

I am trying to use smbclient from my gentoo'd pc to access shares on another gentoo'd pc with samba 3.0.9.

I have spent at least 4 or 5 hours researching this and haven't found a working solution yet, so hopefully it'll happen here.

Using smbclient:   smbclient //tux/   this is the message I keep getting:

smbclient //tux/

password:

Domain=[WORKGROUP] OS=[UNIX] Server=[Samba 3.0.9]

tree connect failed: NT-STATUS_BAD_NETWORK_NAME

Now, having read all the posts on this forum and linuxquestions.org and referring to Using Samba (2nd Edition) that I could find that related to this problem I have tried changing security from user to share, making guest = yes instead of the desired no,

entered a line for name resolve order, and entered a line for domain logons.

None of these have changed anything. I can access this file server from W2K, Mac OS X, and Windows XP.

Here is my smb.conf:

[global]

   workgroup = WORKGROUP

   netbios name = tux

   encrypt passwords = yes

   wins support = yes

   log level = 1

   max log size = 50

   read only = no

   hosts allow = 192.168.0.  127.

   security = share

   username map = /etc/samba/smbusers

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO-SNDBUF=8192

   remote announce = 192.168.0.255

   local master = yes

   os level = 33

   domain master = yes

   invalid users = root bin daemon adm sync shutdown halt mail nes uucp operator

   admin users = dave

   name resolve order = lmhosts, wins, host, bcast

   domain logons = yes

[extra]

   comment = extra storage

   path = /mnt/extra

   read only = no

   guest ok = yes

   writeable = yes

[amy]

   comment = amys extra storage

   path = /mnt/extra/amy /mnt/extra/amy/digital_pics /mnt/extra/amy/amys_stuff

   read only = no

   guest ok = yes

   writeable = yes

   valid users = dave amy

[chloe]

   comment = chloes extra storage

   path = /mnt/extra/chloe

   read only = no

   guest ok = yes

   writeable = yes

   valid users = dave amy chloe

I realize that I may not have needed to add the last two shares but I wanted to avoid having to put them in later.

I found a post here in Gentoo Forums https://forums.gentoo.org/viewtopic.php?t=212115&highlight=smbclient

where the guy mentioned that you could not "share" links like /mnt/extra   or    ln'd files (?).

thanks in advance for any assistanceLast edited by lnxmacusr on Fri Jan 14, 2005 2:45 pm; edited 1 time in total

----------

## rfdonnelly

It has been awhile since I configured samba (before samba3 stable) but you may still benefit from my config. 

```

[global]

   workgroup = Donnelly

   time server = yes

   log file = /var/log/samba/log.%m

   max log size = 50

   security = user

   encrypt passwords = yes

   smb passwd file = /etc/samba/private/smbpasswd

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   dns proxy = no

[homes]

   comment = Home Directories

   browseable = no

   writable = yes

   hide dot files = yes

[tmp]

   comment = Temporary file space

   path = /tmp

   read only = no

   public = yes

   hide dot files = yes

[stor]

   comment = Storage

   path = /stor

   read only = no

   public = yes

   hide dot files = yes

```

Notice the security=user.  I used smbpasswd to add samba users but they must also previously exists in /etc/passwd.  Check man smbpasswd for further details.

The config also allows for anonymous access.  I am guessing this is done with public = yes (its been awhile).  Read and write access is determined by the file permissions on the server.

EDIT: btw, /stor is a mount point much like /mnt/extra so no problem there.  Symlinks might take more configuration.  A man smb.conf may help.

----------

## lnxmacusr

 *rfdonnelly wrote:*   

> It has been awhile since I configured samba (before samba3 stable) but you may still benefit from my config. 
> 
> ```
> 
> [global]
> ...

 

Hey, thanks for the response. I've never had it take so long to get a response. I will try your settings. I think I've done these already, though. It's just really weird how I can access and manipulate and do whatever I need with these files and folders from other platforms, but smbclient won't work.

As an aside, I had actually wanted a gui to do it anyway, a drag 'n drop kind of thing. I emerge'd xftree and xfsamba (xftree can only be gotten with xfce). Using those two I can login to Samba file server and do all that I can do from other 'puters.

I will repost again whether it works or not.

----------

## lnxmacusr

 *lnxmacusr wrote:*   

>  *rfdonnelly wrote:*   It has been awhile since I configured samba (before samba3 stable) but you may still benefit from my config. 
> 
> ```
> 
> [global]
> ...

 

Solution for Problem

Ok, I added a wins server = 192.168.0.103 (samba box) and deleted the line

for domain logons.

I then logged in:

smbclient //tux/extra

password: xxxxxxxx

and was able to access all of my shares.

Thanks to fdonnelly for the guidance. Not 100% sure if the changes I made did the trick or

if I was just trying to login incorrectly: smbclient //tux/mnt/extra   or   //tux/  or  //tux  or //TUX/.  I did notice that I can't login directly into a share inside another share: smbclient//tux/amy. I think that's normal behaviour for Samba.

----------

## rfdonnelly

 *Quote:*   

> Thanks to fdonnelly for the guidance.

 

You're welcome.

 *Quote:*   

> Not 100% sure if the changes I made did the trick or
> 
> if I was just trying to login incorrectly: smbclient //tux/mnt/extra or //tux/ or //tux or //TUX/

 

Ah yes, this was part of the problem.  I missed that part of your first post "smbclient //tux/"

When I do a smbclient //server/ (w/o a share name) I get a "session setup failed: NT_STATUS_LOGON_FAILURE."  This is normal though since you need a share name.  smbclient //server/stor works just fine.

Also, I was skeptical of the domain logons line because I assume that you are just sharing files and not doing anything fancy.

----------

