# Samba is broken - Please help [Solved]

## sonicbhoc

I have finally set up everything almost the way I want it. Almost. This is the only thing holding me back (currently) from having my nearly perfect set up (VST support in LMMS is all I'd be missing, and maybe a MOD tracker).

Ahem. Anyway, I emerged samba with the following useflags:

```

[ebuild   R   ] net-fs/samba-3.0.23a  USE="acl async cups ldap oav pam python readline swat syslog winbind -automount -doc -examples -kerberos -quotas (-selinux)" LINGUAS="ja -pl" 0 kB
```

Here is my samba.conf:

```

[global]

security = share

restrict anonymous = no

domain master = no

preferred master = no

workgroup = LINKSYS

max protocol = NT

acl compatibility = winnt

ldap ssl = No

server signing = Auto

server string = OMG OPTIMIZED

case sensitive = no

strict locking = no

msdfs proxy = no

read only = no

hosts allow = 192.168.1.1

netbios name = COMPAQ

[****'s Compaq Docs]

delete readonly = yes

guest ok = yes

comment = My documents

path = /home/****/

```

Now then, whenever I try to connect to my computer from a KIO slave in KDE on my laptop, I get a timeout on server message. Whenever I do it from smb4k, on my computer and my laptop, I get the error message "NT_STATUS_BAD_NETWORK_NAME". If I do it from my Windows PC, it says the name does not exist. However, in all of these computers, my computer shows up in the list of computers currently in the domain LINKSYS. I can see my computer, but none of the shares I'm sharing appear and double-clicking on my computer's name or typing \\compaq or smb://compaq gets me a bad network name error. What's wrong with it? It can't even connect to itself.

I'm going to go check my hosts.conf and domainname and hostname, maybe something in there is wrong? I don't know, but this is very irritating, to say the least.

Also, until this is fixed, I can't put Gentoo on my IBM T21... again... (I switched to PCLinuxOS on that machine, loved it, but now I want a custom kernel and that didn't work out very well... I need CPU throttling and anything else that can save battery power, because without tweaking things my battery life on Linux is about... 10 minutes.)

I'm going to add more information that may or may not be helpful:

```

# IPv4 and IPv6 localhost aliases

127.0.0.1       localhost COMPAQ

::1     localhost COMPAQ

```

```

# /etc/conf.d/hostname

# Set to the hostname of this machine

HOSTNAME="COMPAQ"

```

```

# /etc/host.conf:

# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/2.3.6/host.conf,v 1.1 2006/02/21 23:35:21 vapier Exp $

# The  file /etc/host.conf contains configuration information specific to

# the resolver library.  It should contain one configuration keyword  per

# line,  followed by appropriate configuration information.  The keywords

# recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.

# This keyword specifies how host lookups are to be performed. It

# should be followed by one or more lookup methods, separated by

# commas.  Valid methods are bind, hosts, and nis.

#

order hosts, bind

# Valid  values are on and off.  If set to on, the resolv+ library

# will return all valid addresses for a host that appears  in  the

# /etc/hosts  file,  instead  of  only  the first.  This is off by

# default, as it may cause a substantial performance loss at sites

# with large hosts files.

#

multi off

```

```

Portage 2.1.1_rc1-r7 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r7-omg-optimized i686)

=================================================================

System uname: 2.6.17-gentoo-r7-omg-optimized i686 Pentium III (Coppermine)

Gentoo Base System version 1.12.4

Last Sync: Thu, 07 Sep 2006 20:30:01 +0000

app-admin/eselect-compiler: [Not Present]

dev-lang/python:     2.4.3-r3

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.18.1

sys-devel/autoconf:  2.13, 2.60

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.17

sys-devel/gcc-config: 1.3.13-r3

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.17

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"

CXXFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LINGUAS="en ja"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 X acl acpi akode alias alsa amr apache2 arts artswrappersuid audiofile autoreplace avahi berkdb bitmap-fonts bootsplash branding buttons bzip2 cairo caps cdda cddb cdparanoia chasen cjk cli connectionstatus contactnotes crypt cups cursors dbus dga dio directfb divx dlloader dri elibc_glibc emoticon encode exscalibar extramodules fbcon fdftk ffmpeg firefox fluidsynth fmod fortran ft gdbm gif glut gmail gmailtimestamps gmedia gpm gs gtk gtk2 hal highlight history hwmixer icons image input_devices_evdev input_devices_joystick input_devices_keyboard input_devices_mouse insecure-savers irc isdnlog java javascript jikes joystick jpeg kde kdexdeltas kdm kernel_linux kipi lame libg++ libsamplerate libwww linguas_en linguas_ja lua lucene migemo mikmod mmx modplug mp3 mpeg mplayer msn music ncurses network nls no-old-linux nowlistening nptl nptlonly nsplugin nspr offensive ogg openal opengl oss pam pcre pdf perl png pop portaudio ppds pppd python qt3 quicktime readline real recode reflection remix rtc samba sdl session soundtouch spamassassin spell spl sse ssl startup-notification statistics svg swat symlink sysfs syslog taglib tagwriting tcpd texteffect theora tools truetype truetype-fonts type1 type1-fonts udev unicode usb userland_GNU userlocales video_cards_i810 video_cards_radeon videos visualization vorbis wifi win32codecs winbind winpopup wmp wxwindows xcomposite xine xml xorg xosd xscreensaver xvid yahoo zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

Last edited by sonicbhoc on Mon Sep 11, 2006 1:42 am; edited 1 time in total

----------

## ter_roshak

Is that all of your smb.conf?

Please post the output of:

```

 testparm -v | egrep 'remote|master|logon|level'

```

----------

## sonicbhoc

```

Load smb config files from /etc/samba/smb.conf

Processing section "[Chaz's Compaq Docs]"

Loaded services file OK.

WARNING: You have some share names that are longer than 12 characters.

These may not be accessible to some older clients.

(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

        password level = 0

        username level = 0

        log level = 0

        logon script =

        logon path = \\%N\%U\profile

        logon drive =

        logon home = \\%N\%U

        domain logons = No

        os level = 20

        preferred master = No

        local master = Yes

        domain master = No

        remote announce =

        remote browse sync =

        winbind offline logon = No

        level2 oplocks = Yes

```

And yes, that's my whole smb.conf.

----------

## ter_roshak

Actually, before getting into that, I just noticed this setting from your smb.conf:

```

hosts allow = 192.168.1.1 

```

Is this one of your hosts, or is this your gateway?  As it stands, this is the only host who is currently able to access your shares.  I typically open this up to every network where I have hosts who should be able to access the shares, like:

```

hosts allow = 192.168.1. 127.

```

----------

## Naib

have you used smbpasswd to add a valid user?

this is my smb.conf that work

```

[global]

   netbios name = FLUID-SLUG

   netbios aliases = FLUID-SLUG

   server string = Samba Server

   map to guest = Bad User

   null passwords = Yes

   smb passwd file = /etc/samba/smbpasswd

   log file = /var/log/samba/%M

   max log size = 10

   name resolve order = wins bcast

   socket options = TCP_NODELAY  IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535

   load printers = No

   os level = 8

   preferred master = Yes

   dns proxy = No

   ldap ssl = no

   create mask = 0660

   force create mode = 0660

   force directory mode = 0771

   hosts allow = 127.0.0.1, 10.0.0., 10.0.1., 10.0.2., 192.168.0., 192.168.1.

   case sensitive = No

   veto files = /.ShareConfFile/quota.user/quota.user~/lost+found/

   map system = Yes

[Torrents]

   comment = Torrent Store

   path = /opt/DATA/Torrents

   valid users = USER1, ADMIN

   ADMIN users = ADMIN

   read list = USER1, ADMIN

   write list = USER1, ADMIN

   force user = USER1

   force group = users

   read only = No

[mp3]

   comment = MP3 files

   path = /opt/DATA/mp3

   valid users = USER1, ADMIN

   ADMIN users = ADMIN

   read list = USER1, ADMIN

   write list = USER1, ADMIN

   force user = USER1

   force group = users

   read only = No

[ROOT]

   comment = Root system

   path = /

   valid users = ADMIN

   ADMIN users = ADMIN

   read list = ADMIN

   write list = ADMIN

   force user = root

   force group = root

   read only = No

[Jon]

   comment = USER1's documents & files

   path = /opt/DATA/documents/Jon

   valid users = USER1, ADMIN

   ADMIN users = ADMIN

   read list = USER1, ADMIN

   write list = USER1, ADMIN

   force user = USER1

   force group = users

   read only = No

[USER2]

   comment = USER2's documents & files

   path = /opt/DATA/documents/USER2

   valid users = USER2, ADMIN

   ADMIN users = ADMIN

   read list = USER2, ADMIN

   write list = USER2, ADMIN

   force user = USER2

   force group = users

   read only = No

[Photos]

   comment = Photo Album

   path = /opt/DATA/documents/Pictures

   valid users = USER1,USER2, ADMIN

   ADMIN users = ADMIN

   read list = USER1,USER2, ADMIN

   write list = USER1,USER2, ADMIN

   force user = USER1

   force group = users

   read only = No

[Misc]

   comment = MP3 files

   path = /opt/DATA/misc

   valid users = USER1, ADMIN

   ADMIN users = ADMIN

   read list = USER1, ADMIN

   write list = USER1, ADMIN

   force user = USER1

   force group = users

   read only = No

```

----------

## sonicbhoc

 *ter_roshak wrote:*   

> Actually, before getting into that, I just noticed this setting from your smb.conf:
> 
> ```
> 
> hosts allow = 192.168.1.1 
> ...

 

That's my router. Every computer, including mine, runs through that thing. Should I change it to "192.168.1. 127. "?

Nope. Still Bad Network Name error. I'm going to downgrade Samba and see what happens.

I'm going to try adding a netbios alias and see if that works. And Map to Guest and Null Passwords might be a good idea to add too.

----------

## ter_roshak

Try adding the following:

```

remote announce = 192.168.1.255

wins support = yes

```

..and yes, change your hosts allow to the one I listed.

**You can view all of your settings with testparm -v, which may help you tremendously if you want to peruse all of them.

----------

## sonicbhoc

remote announce = 192.168.1.255  <<--- What's that do?

I don't have wins support enabled... maybe that's it?

----------

## sonicbhoc

I upgraded to samba 3.0.23c and it still doesn't work. It keeps saying Bad Network Name... I can't connect to it from any computer, but I can connect to every other computer on the network. It's not broadcasting properly but I can read and write across the network just fine. <_<

This is really starting to piss me off... 3 days of working with this and it still doesn't work. 3 whole days. I'm so pissed...  :Evil or Very Mad: 

```

Load smb config files from /etc/samba/smb.conf

Processing section "[****'s Compaq Docs]"

Loaded services file OK.

WARNING: You have some share names that are longer than 12 characters.

These may not be accessible to some older clients.

(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

[global]

        dos charset = CP850

        unix charset = UTF-8

        display charset = UTF-8

        workgroup = LINKSYS

        realm =

        netbios name = COMPAQ

        netbios aliases = COMPAQ

        netbios scope =

        server string = OMG OPTIMIZED

        interfaces =

        bind interfaces only = No

        security = SHARE

        auth methods =

        encrypt passwords = Yes

        update encrypted = No

        client schannel = Auto

        server schannel = Auto

        allow trusted domains = Yes

        map to guest = Bad User

        null passwords = Yes

        obey pam restrictions = No

        password server = *

        smb passwd file = /var/lib/samba/private/smbpasswd

        private dir = /var/lib/samba/private

        passdb backend = smbpasswd

        algorithmic rid base = 1000

        root directory =

        guest account = nobody

        enable privileges = Yes

        pam password change = No

        passwd program =

        passwd chat = *new*password* %n\n *new*password* %n\n *changed*

        passwd chat debug = No

        passwd chat timeout = 2

        check password script =

        username map =

        password level = 0

        username level = 0

        unix password sync = No

        restrict anonymous = 0

        lanman auth = Yes

        ntlm auth = Yes

        client NTLMv2 auth = No

        client lanman auth = Yes

        client plaintext auth = Yes

        preload modules =

        use kerberos keytab = No

        log level = 0

        syslog = 1

        syslog only = No

        log file =

        max log size = 5000

        debug timestamp = Yes

        debug hires timestamp = No

        debug pid = No

        debug uid = No

        enable core files = Yes

        smb ports = 445 139

        large readwrite = Yes

        max protocol = NT1

        min protocol = CORE

        read bmpx = No

        read raw = Yes

        write raw = Yes

        disable netbios = No

        reset on zero vc = No

        acl compatibility = winnt

        defer sharing violations = Yes

        nt pipe support = Yes

        nt status support = Yes

        announce version = 4.9

        announce as = NT

        max mux = 50

        max xmit = 16644

        name resolve order = lmhosts wins host bcast

        max ttl = 259200

        max wins ttl = 518400

        min wins ttl = 21600

        time server = No

        unix extensions = Yes

        use spnego = Yes

        client signing = auto

        server signing = auto

        client use spnego = Yes

        enable asu support = No

        svcctl list =

        deadtime = 0

        getwd cache = Yes

        keepalive = 300

        kernel change notify = Yes

        fam change notify = Yes

        lpq cache time = 30

        max smbd processes = 0

        paranoid server security = Yes

        max disk size = 0

        max open files = 10000

        open files database hash size = 10007

        socket options = TCP_NODELAY

        use mmap = Yes

        hostname lookups = Yes

        name cache timeout = 660

        load printers = Yes

        printcap cache time = 750

        printcap name =

        cups server =

        iprint server =

        disable spoolss = No

        addport command =

        enumports command =

        addprinter command =

        deleteprinter command =

        show add printer wizard = Yes

        os2 driver map =

        mangling method = hash2

        mangle prefix = 1

        max stat cache size = 0

        stat cache = Yes

        machine password timeout = 604800

        add user script =

        rename user script =

        delete user script =

        add group script =

        delete group script =

        add user to group script =

        delete user from group script =

        set primary group script =

        add machine script =

        shutdown script =

        abort shutdown script =

        username map script =

        logon script =

        logon path = \\%N\%U\profile

        logon drive =

        logon home = \\%N\%U

        domain logons = No

        os level = 20

        lm announce = Auto

        lm interval = 60

        preferred master = No

        local master = No

        domain master = No

        browse list = Yes

        enhanced browsing = Yes

        dns proxy = Yes

        wins proxy = No

        wins server =

        wins support = Yes

        wins hook =

        kernel oplocks = Yes

        lock spin count = 3

        lock spin time = 10

        oplock break wait time = 0

        ldap admin dn =

        ldap delete dn = No

        ldap group suffix =

        ldap idmap suffix =

        ldap machine suffix =

        ldap passwd sync = no

        ldap replication sleep = 1000

        ldap suffix =

        ldap ssl = no

        ldap timeout = 15

        ldap page size = 1024

        ldap user suffix =

        add share command =

        change share command =

        delete share command =

        eventlog list =

        config file = /etc/samba/smb.conf

        preload =

        lock directory = /var/cache/samba

        pid directory = /var/run/samba

        utmp directory =

        wtmp directory =

        utmp = No

        default service =

        message command =

        get quota command =

        set quota command =

        remote announce = 192.168.1.

        remote browse sync =

        socket address = 0.0.0.0

        homedir map =

        afs username map =

        afs token lifetime = 604800

        log nt token command =

        time offset = 0

        NIS homedir = No

        usershare allow guests = Yes

        usershare max shares = 0

        usershare owner only = No

        usershare path = /var/cache/samba/usershares

        usershare prefix allow list =

        usershare prefix deny list =

        usershare template share =

        panic action =

        host msdfs = Yes

        passdb expand explicit = No

        idmap backend =

        idmap uid =

        idmap gid =

        template homedir = /home/%D/%U

        template shell = /bin/false

        winbind separator = \

        winbind cache time = 300

        winbind enum users = No

        winbind enum groups = No

        winbind use default domain = No

        winbind trusted domains only = No

        winbind nested groups = Yes

        winbind nss info = template

        winbind refresh tickets = No

        winbind offline logon = No

        comment =

        path =

        username =

        invalid users =

        valid users = (all usernames including root)

        admin users = (my username and root)

        read list =

        write list =

        printer admin =

        force user =

        force group =

        read only = No

        acl check permissions = Yes

        acl group control = No

        acl map full control = Yes

        create mask = 0744

        force create mode = 00

        security mask = 0777

        force security mode = 00

        directory mask = 0755

        force directory mode = 00

        directory security mask = 0777

        force directory security mode = 00

        force unknown acl user = No

        inherit permissions = No

        inherit acls = No

        inherit owner = No

        guest only = No

        guest ok = Yes

        only user = No

        hosts allow = 192.168.1., 127.

        hosts deny =

        allocation roundup size = 1048576

        aio read size = 0

        aio write size = 0

        aio write behind =

        ea support = No

        nt acl support = Yes

        profile acls = No

        map acl inherit = No

        afs share = No

        block size = 1024

        change notify timeout = 60

        max connections = 0

        min print space = 0

        strict allocate = No

        strict sync = No

        sync always = No

        use sendfile = No

        write cache size = 0

        max reported print jobs = 0

        max print jobs = 1000

        printable = No

        printing = cups

        cups options =

        print command =

        lpq command = %p

        lprm command =

        lppause command =

        lpresume command =

        queuepause command =

        queueresume command =

        printer name =

        use client driver = No

        default devmode = Yes

        force printername = No

        default case = lower

        case sensitive = No

        preserve case = Yes

        short preserve case = Yes

        mangling char = ~

        hide dot files = No

        hide special files = No

        hide unreadable = No

        hide unwriteable files = No

        delete veto files = No

        veto files =

        hide files =

        veto oplock files =

        map archive = Yes

        map hidden = No

        map system = No

        map readonly = yes

        mangled names = Yes

        mangled map =

        store dos attributes = No

        dmapi support = No

        browseable = Yes

        blocking locks = Yes

        csc policy = manual

        fake oplocks = No

        locking = No

        oplocks = Yes

        level2 oplocks = Yes

        oplock contention limit = 2

        posix locking = Yes

        strict locking = No

        share modes = Yes

        dfree cache time = 0

        dfree command =

        copy =

        include =

        preexec =

        preexec close = No

        postexec =

        root preexec =

        root preexec close = No

        root postexec =

        available = Yes

        volume =

        fstype = NTFS

        set directory = No

        wide links = Yes

        follow symlinks = Yes

        dont descend =

        magic script =

        magic output =

        delete readonly = No

        dos filemode = No

        dos filetimes = Yes

        dos filetime resolution = No

        fake directory create times = No

        vfs objects =

        msdfs root = Yes

        msdfs proxy = no

[****'s Compaq Docs]

        comment = My documents

        path = /home/****/

        delete readonly = Yes

```

I don't see anything wrong with this thing... Every time under any Linux system... including Gentoo 2005.1... all I had to do was emerge samba and change the type to share and the workgroup to LINKSYS and it worked. What the heck is going on!?

----------

## sonicbhoc

I fixed it... all I had to do was revert to samba 3.0.22-r3.

This wasn't my favorite solution... Could it have been the LINGUAS="en ja" in my make.conf?

----------

## ter_roshak

Ok, the remote announce directive is what announces to subnets the available shares and services, but this has defaulted to 192.168.1 so you don't need to change this.  (You actually do not have to announce this to your local subnet.)

What you should change, if you don't have a local WINS server or other master browser, is to set the following directive, which will populate the local browse list of Netbios names (ie, populate network neighborhood):

```

local master = Yes

preferred master = Yes

```

Restart or reload samba and let it do it's magic for 5-15 minutes then try again

```
smbcontrol smbd reload-config
```

----------

## sonicbhoc

I have almost everything working but I can't write to my box from other computers. If I can fix this I'd be golden.

I don't remember this ever being this difficult <_<

----------

## ter_roshak

I just reviewed all of the release notes from Samba 3.0.22 to 3.0.23 and did not see anything that would make the behavior different.  I think the next logical step would be to use your working version to baseline the configuration with testparm -v and then compare that with the 3.0.23 version and see what is causing the error.

----------

## sonicbhoc

I got it working with Samba 3.0.22, but now I remembered that I emerged everything on my other computer with LINGUAS="en ja" ...and forgot to install the Japanese fonts. On top of that, it was a big waste of time because the only thing that needed Japanese support was KDE, so that my music shows up properly. On top of that, seeing as I compiled everything with Unicode support, I'm betting that all I needed to do was install at least one Unicode Japanese font and it would work. Oh well.

But, I did get Samba working. and I know my files will copy over properly. Well, except for the names. But yeah.

----------

