# Samba problem



## phreak (Aug 23, 2010)

I have recently set up 2 FreeBSD machines, both running 8.1-RELEASE. Samba 3.4 installed on both machines.

The Samba server can be browsed and access from Windows XP clients and the Samba client can access resources shared from Windows Servers as well. However, The Samba client cannot connect to the Samba server. :r

Here are my /usr/local/etc/smb.conf

```
# Samba config file created using SWAT
# from UNKNOWN (192.168.10.27)
# Date: 2010/08/19 11:55:18

[global]
	workgroup = FREEBSD
	server string = FreeBSD Samba Server
	map to guest = Bad User
	log file = /var/log/samba34/log.%m
	max log size = 50
	logon path = \\%25N\%25U\profile
	logon home = \\%25N\%25U
	domain master = No
	dns proxy = No
	write list = rs
	guest ok = Yes
	hosts allow = 192.168.10.
	hosts deny = 192.168.10.254

[homes]
	comment = Home Directories
	valid users = %s
	read only = No
	guest ok = No
	available = No

[printers]
	comment = All Printers
	path = /var/spool/samba34
	guest ok = No
	printable = Yes
	browseable = No
	browsable = No
	available = No

[share]
	comment = Images for web recognition server
	path = /share
	read list = nobody
	read only = No
[homes]
	comment = Home Directories
	valid users = %s
	read only = No
	guest ok = No
	available = No
```

I was trying to mount it from with the following command:
`# mount -t smbfs -o rw,-I=192.168.10.12,-U=user //server/share /smb/share`
It returns:

```
mount_smbfs: unable to open connection: syserr = Operation timed out
```
I did try to ping the Samba server from the Samba client and it was fine.

The Samba was installed from port, version samba34-3.4.8, with the following config from menu:

```
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
     x                    Options for samba34 3.4.8                       x
     x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
     x x  [X] LDAP         With LDAP support                            x x
     x x  [ ] ADS          With Active Directory support                x x
     x x  [X] CUPS         With CUPS printing support                   x x
     x x  [X] WINBIND      With WinBIND support                         x x
     x x  [X] SWAT         With SWAT WebGUI                             x x
     x x  [X] ACL_SUPPORT  With ACL support                             x x
     x x  [X] AIO_SUPPORT  With Asyncronous IO support                  x x
     x x  [X] FAM_SUPPORT  With File Alteration Monitor                 x x
     x x  [X] SYSLOG       With Syslog support                          x x
     x x  [X] QUOTAS       With Disk quota support                      x x
     x x  [ ] UTMP         With UTMP accounting support                 x x
     x x  [ ] PAM_SMBPASS  With PAM authentication vs passdb backends   x x
     x x  [ ] DNSUPDATE    With dynamic DNS update(require ADS)         x x
     x x  [X] AVAHI        With Bonjour service discovery support       x x
     x x  [ ] EXP_MODULES  With experimental modules                    x x
     tqmqqqqqqv(+)qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
     x                       [  OK  ]       Cancel                        x
     mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
```

*What did I do wrong?*

Furthermore, I found that the FREEBSD workgroup does show up on Windows clients but cannot be browsed. Is there something else to be set?

Many thanks!


----------



## phreak (Aug 24, 2010)

Further investigation on the issue, I have found an entry on the Samba server with the ip of the Samba client. The log is empty though. There are logs of other Windows client as well. The logs of Windows clients has some error messages in the file.


----------



## phreak (Aug 24, 2010)

I have tried smbclient from the Samba client machine and it works! The problem is narrowed down to mount_smbfs now. Keep digging...


----------



## phreak (Aug 25, 2010)

I have made some progress. The mount_smbfs works now. And I have successfully mounted the Samba server. Unfortunately, I cannot browse the directory in mounted directory. The Windows client and smbclient has no problem listing the content of the directory though.

Here is the configurations.

In /etc/amd.smb:

```
share    fs:=${autodir}${path};type:=program;mount:="/sbin/mount mount -t smbfs -o rw,-N,-d=0775,-f=0664 \\\/\\\/rs@host/share ${fs}";
```

Could somebody give me a pointer? Thanks a ton!


----------



## phreak (Aug 25, 2010)

Forgot to mention, the samba client machine has no problem browsing directory shared from Windows XP servers and Windows XP clients has no problem browsing the directory served from Samba server.

However, the Samba client mounted the directory shared by the Samba server cannot list the content of the directory but has no problem access files given the correct filenames.


----------



## JimW (Aug 26, 2010)

phreak said:
			
		

> Furthermore, I found that the FREEBSD workgroup does show up on Windows clients but cannot be browsed. Is there something else to be set?



You need to have your Windows clients members of the same "Workgroup" that your FreeBSD Samba server is using. In your case, the Workgroup name seems to be FREEBSD.

It's been a while since I used *mount_smbfs*, but it looks like you are not using the correct syntax in your mount commands.

Check the *mount_smbfs* man page *here*.


----------



## phreak (Aug 26, 2010)

JimW said:
			
		

> You need to have your Windows clients members of the same "Workgroup" that your FreeBSD Samba server is using. In your case, the Workgroup name seems to be FREEBSD.
> 
> It's been a while since I used *mount_smbfs*, but it looks like you are not using the correct syntax in your mount commands.
> 
> Check the *mount_smbfs* man page *here*.



Thanks for your help. I have no idea on what is going on but the directory is browsable today on the Samba client with the Samba server all without any changes.

As the /etc/amd.smb syntax, it was not for mount_smbfs but it was used in AMD with smbfs.

The Workgroup problem was solved by adding

```
local master = yes
preferred master = Yes
```
into [global] section.

Everything works as expected. Thanks for the comments.


----------

