# Hmm, newbie with samba, I just dont get it.



## zakka (Apr 16, 2009)

Hmm, I can't get Samba to work, I know it cant be anywhere far for working, but I don't have any ideas left :/

if I use "smbclient //localhost/tmp" to test samba, without giving password, it seem to work:


```
$ smbclient //localhost/tmp
Password:
Anonymous login successful
Domain=[CATS] OS=[Unix] Server=[Samba 3.0.32]
smb: \> quit
$
```

here I could us it as it should be (seems to work normal andI can browse my tmp dir)


But if I give it my password when it ask it:


```
$ smbclient //localhost/tmp
Password:
session setup failed: NT_STATUS_LOGON_FAILURE
$
```


I used "pdbedit -a -u MyAccountName" to add used and entered pass for it


I do know it reads options from smb.conf file, I try to chance some options like workgrp and it showed it when I logged as anonym.


when I gave pass while I try to log it did some log files:

```
-rw-r--r--  1 root  wheel     0 Apr 16 20:04 log.
-rw-r--r--  1 root  wheel     0 Apr 16 20:04 log.127.0.0.1
```

But all of those are 0 bytes

But if I log without giving password and then quit, it adds to log. next trings:


```
[2009/04/16 20:05:43, 1] smbd/service.c:make_connection_snum(1033)
   (127.0.0.1) connect to service tmp initially as user nobody (uid=65534, gid=65534) (pid 68431)
[2009/04/16 20:05:45, 1] smbd/service.c:close_cnum(1230)
   (127.0.0.1) closed connection to service tmp
```



What I should check next?



And my settings:



```
# testparm -s
Load smb config files from /usr/local/etc/smb.conf
Processing section "[homes]"
Processing section "[tmp]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
        workgroup = CATS
        server string = Samba Server
        interfaces = 192.168.1.4/24
        passdb backend = tdbsam
        log file = /var/log/samba/log.%m
        max log size = 50
        load printers = No
        logon script = %U.bat
        preferred master = Yes
        domain master = Yes
        dns proxy = No
        hosts allow = 192.168.1., 192.168.2., 127.

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[tmp]
        comment = Temporary file space
        path = /tmp
        guest ok = Yes
#
```

most of time I used http://www.csua.berkeley.edu/~ranga/notes/freebsd_samba.html quide and followed it somewhat carefully


----------



## SirDice (Apr 16, 2009)

zakka said:
			
		

> $ smbclient //localhost/tmp
> Password:
> session setup failed: NT_STATUS_LOGON_FAILURE
> $
> ...


Please use code tags...

Try:

```
$ smbclient -U MyAccountName //localhost/tmp
```


----------



## zakka (Apr 16, 2009)

Same still

```
$ smbclient -U leopard //localhost/tmp
Password:
session setup failed: NT_STATUS_LOGON_FAILURE
```


Sorry missing about tags earlier, somehow I forgot those.


----------



## Gkarfield (Apr 17, 2009)

try "smbclient -U <name> -I x.x.x.x //x.x.x.x/tmp"  , where x.x.x.x is machine's address  that you  want to connect to


----------



## Gkarfield (Apr 17, 2009)

also [ just tested] , if you  give machine'a name  in capitals, it works just with 'smbclient //<machine>/<share>' 

  by the way , do you know wich ports  uses smb?  [it is blocked by my firewall]


----------



## zakka (Apr 24, 2009)

Gkarfield said:
			
		

> also [ just tested] , if you  give machine'a name  in capitals, it works just with 'smbclient //<machine>/<share>'





> by the way , do you know wich ports  uses smb?  [it is blocked by my firewall]



Hmm, I never tought Firewall, I did freebsd minimum install and never tought to check that. Note that this lan doesn't need FW, its just for testing (learning)

But there is something weird tho, if I do:

```
smbclient -U leopard -I 192.168.1.4 //192.168.1.4/tmp
```

with pass I'll get: NT_STATUS_LOGON_FAILURE 
or without +disabled anonymous account:

Anonymous login successful
Domain=[CATS] OS=[Unix] Server=[Samba 3.0.32]
tree connect failed: NT_STATUS_ACCESS_DENIED


But in both cases logs are empty.


```
-rw-r--r--  1 root  wheel     0 Apr 24 16:50 log.192.168.1.4
-rw-r--r--  1 root  wheel     0 Apr 24 16:50 log.smbd
```

I think incorrect login were logged earlier, but not 100% sure tho


----------



## SirDice (Apr 24, 2009)

Gkarfield said:
			
		

> also [ just tested] , if you  give machine'a name  in capitals, it works just with 'smbclient //<machine>/<share>'


Hostnames are not case-sensitive.



> by the way , do you know wich ports  uses smb?  [it is blocked by my firewall]



Smb is notoriously tricky to firewall but 137/udp (netbios-ns), 138/udp (netbios-dgm), 139/tcp (netbios-ssn) and 445/tcp (netbios-ds).

Do note that, by default, there's no firewall active on FreeBSD. You have to enable it after the install.


----------

