# samba error: NT_STATUS_BAD_NETWORK_NAME

## blendmaster

Hello.

```
# smbclient -L cyan

Password:

Anonymous login successful

Domain=[RUPPERT] OS=[Unix] Server=[Samba 3.0.2a]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

# smbclient -L 127.0.0.1 -U root

Password:

Domain=[CYAN] OS=[Unix] Server=[Samba 3.0.2a]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

# smbclient -L cyan -U root

Password:

Domain=[CYAN] OS=[Unix] Server=[Samba 3.0.2a]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

# smbclient -L 127.0.0.1

Password:

Domain=[CYAN] OS=[Unix] Server=[Samba 3.0.2a]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

# smbclient //RUPPERT/cyan -U root

Connection to RUPPERT failed

# smbclient //RUPPERT/cyan

Connection to RUPPERT failed

```

and thats my problem.

smb.conf:

```
[global]

# Replace MYWORKGROUPNAME with your workgroup/domain

workgroup = RUPPERT

# Of course this has no REAL purpose other than letting

# everyone know its not Windows!

# %v prints the version of Samba we are using.

server string = %h running Samba Server %v

# We are going to use cups, so we are going to put it in here ;-)

printcap name = cups

printing = cups

load printers = yes

# We want a log file and we do not want it to get bigger than 50kb.

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

max log size = 50

# We are going to set some options for our interfaces...

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# This is a good idea, what we are doing is binding the

# samba server to our local network.

# For example, if eth0 is our local network device

interfaces = lo eth0

bind interfaces only = yes

# Now we are going to specify who we allow, we are afterall

# very security conscience, since this configuration does

# not use passwords!

hosts allow = 127.0.0.1 192.168.2.1/24

hosts deny = 0.0.0.0/0

# Other options for this are USER, DOMAIN, ADS, and SERVER

# The default is user

security = user

# No passwords, so we're going to use a guest account!

guest account = samba

guest ok = yes

# We now will implement the on access virus scanner.

# NOTE: By putting this in our [Global] section, we enable

# scanning of ALL shares, you could optionally move

# these to a specific share and only scan it.

vfs object = /usr/lib/samba/vfs/vscan-clamav.so

#vfs options = config-file = /etc/samba/vscan-clamav.conf

 

# Now we setup our print drivers information!

[print$]

comment = Printer Drivers

path = /etc/samba/printer # this path holds the driver structure

guest ok = no

browseable = yes

read only = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

write list = root

 

# Now we'll setup a printer to share, while the name is arbitrary

# it should be consistent throughout Samba and CUPS!

[HPPSC1210]

comment = HP PSC 1210

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

 

# Now we setup our printers share.  This should be

# browseable, printable, public.

[printers]

comment = All Printers

browseable = yes

printable = yes

public = yes

guest ok = yes

path = /var/spool/samba

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

 

# We create a new share that we can read/write to from anywhere

# This is kind of like a public temp share, anyone can do what

# they want here.

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/samba/public

```

i've searched these forums and google and many people had that problem but almost no one had an answer and the ones that did have a solution didn't apply to me.

P.S I tried to get on #samba on irc.freenode.net with xchat but even though it shows about 55 people there, i don't see any messages.

----------

## g3n

Try to access the win computer something like this:

```
smbclient "//ComputerName//Documents c"
```

You only need to enclose the resource in quotes and when it ask for password just hit enter.

----------

## g3n

You dont need the smb.conf working for doing this btw.

And maybe you should want to change the security to share, that's the way almost all windows works

 *Quote:*   

> 
> 
> ```
> security = user 
> ```
> ...

 

to

```
security = share
```

----------

## nobspangle

 *g3n wrote:*   

> And maybe you should want to change the security to share, that's the way almost all windows works
> 
> 

 

Windows NT,2k,XP all use user level

----------

## blendmaster

i changed in smb.conf to user = share.  i still can't access my own computer.  im trying to get cupsaddsmb to work so i need access to my own computer (cyan). my attempts:

```
root@cyan steven # smbclient //magenta/Steven

Password:

Domain=[MAGENTA] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

smb: \> quit

root@cyan steven # smbclient //cyan/public

Password:

Domain=[RUPPERT] OS=[Unix] Server=[Samba 3.0.2a]

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

```

windows works but linux doesn't.  another note, on winxp pro  i can't view the workgroup computers because "the network is not configured for transactions".   In the Computer Name section of the System in the Control Panel i have it set to the workgroup "RUPPERT" because when i set the domain to "RUPPERT" it says i can't join. should i be in the domain?

edit: /etc/hosts:

```

127.0.0.1       cyan

# IPV6 versions of localhost and co

::1 ip6-cyan ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

is this right? i read the topic  https://forums.gentoo.org/viewtopic.php?t=189047

and thought somthing might be wrong.

also, /etc/hostname: "cyan" and /etc/dnsdomainname: "RUPPERT" ( without the quotes)

----------

## RedDawn

Try this!!

make this file..     

/etc/conf.d/samba

with this in it! 

daemon_list="smbd nmbd"

#----------------------------------------------------------------------------

# Daemons calls: <daemon_name>_<command_option>

#----------------------------------------------------------------------------

my_service_name="samba"

my_service_PRE="unset TMP TMPDIR"

my_service_POST=""

#----------------------------------------------------------------------------

# Daemons calls: <daemon_name>_<command_option>

#----------------------------------------------------------------------------

smbd_start_options="-D"

smbd_start="start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- ${smbd_st

art_options}"

smbd_stop="start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid"

smbd_reload="killall -HUP smbd"

nmbd_start_options="-D"

nmbd_start="start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- ${nmbd_st

art_options}"

nmbd_stop="start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid"

nmbd_reload="killall -HUP nmbd"

----------

## blendmaster

still no worky

----------

## RedDawn

 *blendmaster wrote:*   

> still no worky

 

did you?

/etc/init.d/samba restart ??

weird!   :Confused: 

----------

## blendmaster

i do that whenever i change a config file.

----------

## rodrigrj

ive got the same problem... only i can get to some services but not others

ie: 

```
smbclient //localhost/printers -U root  
```

works fine, but  

```
 smbclient //localhost/print$ -U root
```

gives me the NT_STATUS_BAD_NETWORK_NAME error

tried making the entry for [print$] the same as [printers] but that didnt help any.

----------

## rodrigrj

ive got a real sloppy fix...

i used the sample samba conf file (smb.conf.example) and then i could add

the printer

then i restarted samba with my conf file, and everything still works... not sure 

why this is especially since i copied what was the example into my file...

----------

