# Samba Woes (Help)

## Dr_Dooom33

Im trying to display my linux shares in windows. However I get this

```

XFSAMBA> nmblookup -M -- -

XFSAMBA> nmblookup -A 192.168.0.2

XFSAMBA> smbclient -N -L //MEGATRON

Error connecting to 192.168.0.2 (Connection refused)

XFSAMBA> smbclient -N -L //MEGATRON

Error connecting to 192.168.0.2 (Connection refused)

```

Why is my connection refused. Why is my SMB query failing?

Please help. I fyou need to see a file or anything to help you please let me know what you need to see. Im a noob and dont know much when it comes to config files

----------

## sloof3

There's a dozen reasons you can't see the shares.  More information is need:

Paste in here your smb.conf file without comments.

-sloof3

----------

## Dr_Dooom33

```

[global]

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

   guest account = samba

   load printers = yes

   socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192

   vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

   vfs object = vscan-clamav

   guest ok = yes

   interfaces = lo eth0

   hosts allow = 127.0.0.1 192.168.1.0/24

   netbios name = megatron

   server string = Samba Server %v

   printing = cups

   workgroup = scorponok

   os level = 20

   hosts deny = 0.0.0.0/0

   printcap name = cups

   security = share

   bind interfaces only = yes

   max log size = 50

[print$]

comment = Printer Drivers

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

guest ok = yes

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!

[HPDeskJet940C]

   printer = Hp_Deskjet_940c

   printable = yes

   path = /var/spool/samba

   guest ok = yes

   comment = HP DeskJet 940C Network Printer

   public = yes

   printer admin = root

[printers]   

comment = All Printers

browseable = no 

printable = yes   

writable = no

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

[archeives]

   path = /arheives

[Upload]

   comment = Upload

   valid users = edward,sshuser

   path = /arheives/Upload

   write list = edward,sshuser

   allow hosts = 127.0.0.1 192.168.0.0/24

```

----------

## sloof3

hosts allow = 127.0.0.1 192.168.1.0/24

----------

## Dr_Dooom33

 *sloof3 wrote:*   

> hosts allow = 127.0.0.1 192.168.1.0/24

 

I made the change to 

allow=192.168.0.0/24

however I cant start samba:

```

etc/init.d/samba restart

 * samba -> start: smbd ...                                               [ !! ]

 * samba -> start: nmbd ...                                               [ ok ]

 * Error: stopping services (see system logs)

 * samba -> stop: smbd ...                                                [ !! ]

 * samba -> stop: nmbd ...                                                [ !! ]

```

----------

## beandog

Sometimes samba stop doesn't actually kill the processes, and sometimes reload doesnt actually stop then restart them.  I'd try doing /etc/init.d/samba stop, and if it complains just do zap, make sure no samba daemons are running, then start it back up again.  Also, check your logs (as init instructs) for any helpful errors.  You can always change smb.conf to dump more verbose data, too.

----------

## Dr_Dooom33

```
/etc/init.d/samba stop

 * ERROR:  "samba" has not yet been started.

```

Cant even stop it

my config file is above I posted it to ask is there anything unusual about it. I tried all that I know and just tried your advise

please help. Im patient.

Thanks

OH as a noob what sys logs are you talking about please be clear.

----------

## beandog

 *Dr_Dooom33 wrote:*   

> 
> 
> ```
> /etc/init.d/samba stop
> 
> ...

 

```
/etc/init.d/samba zap
```

 *Dr_Dooom33 wrote:*   

> OH as a noob what sys logs are you talking about please be clear.

 

Should be somewhere in /var/log/samba.  Just tail them to see what theyre doing.

```
tail -f /var/log/samba/samba.log
```

----------

## Dr_Dooom33

 *beandog wrote:*   

>  *Dr_Dooom33 wrote:*   
> 
> ```
> /etc/init.d/samba stop
> 
> ...

 

I did tail -f /var/log/samba/log.smbd

and got: 

```

[2005/10/30 11:24:49, 1] param/loadparm.c:lp_do_parameter(3283)

  WARNING: The "printer admin" option is deprecated

[2005/10/30 11:24:49, 1] param/loadparm.c:lp_do_parameter(3283)

  WARNING: The "printer admin" option is deprecated

[2005/10/30 11:24:49, 0] printing/print_cups.c:cups_cache_reload(85)

  Unable to connect to CUPS server localhost - Connection refused

[2005/10/30 11:24:49, 0] printing/print_cups.c:cups_cache_reload(85)

  Unable to connect to CUPS server localhost - Connection refused

[2005/10/30 11:24:50, 1] auth/auth_util.c:make_server_info_sam(807)

  User samba in passdb, but getpwnam() fails!

```

what is up with  getpwnam()? What is that?

----------

## MrUlterior

 *Dr_Dooom33 wrote:*   

> ...

 

I think the problem is this line:

```
guest account = samba 
```

Does the user exist? This is normally set to "nobody".

See:

 *Quote:*   

> guest account (G)
> 
>     This is a username which will be used for access to services which are specified as guest ok (see below). Whatever privileges this user has will be available to any client connecting to the guest service. This user must exist in the password file, but does not require a valid login. The user account "ftp" is often a good choice for this parameter.
> 
>     On some systems the default guest account "nobody" may not be able to print. Use another account in this case. You should test this by trying to log in as your guest user (perhaps by using the su - command) and trying to print using the system print command such as lpr(1) or lp(1).
> ...

 

If this still doesn't help, in your place I'd begin commenting & uncommenting out (line at a time) and running "/etc/init.d/samba stop && /etc/init.d/samba zap  && /etc/init.d/samba  start" after each line to find where your problems lie ...

----------

## linear

Another little utility that comes with the samba package that might help you isolate where your 

problem with this configuration is 'testparm'.

In following what MrUlterior was saying about commenting out each config line in your smb.conf 

file and trying it, I would think that after making the line into a comment, the next thing you 

would want to try before '/etc/init.d/samba start' would be:

```

testparm /etc/samba/smb.conf

```

It will parse (read) your smb.conf file and let you know if it sees anything messed up in it.

Hope that helps.

/bk

----------

