# Trying to set up a Samba file server.



## TooLSHeD (Dec 30, 2010)

Hi

I'm quite new to FreeBSD, I've got box that I'm trying to set up as a dedicated file storage server for my house. The clients are all Windows 7.

I've installed Samba35 from ports and I've been trying for the last few days to connect from a Win 7 machine. I've read up on every site imaginable and currently I'm running through the list on http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch12_:_Samba_Security_and_Troubleshooting. 

Everything works up until point 6 when I have to run "net view \\samba-server" from the client, I get:

```
PS C:\Users\Rael> net view \\SAMBA_SERVER
System error 5 has occurred.

Access is denied.
```

Can anyone please give me a reason as to why it fails?

Thanks


----------



## SirDice (Dec 30, 2010)

Every site? Did you read the official documentation?

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/


----------



## codeWarrior (Dec 30, 2010)

the answer is right there in front of you: permissions.  Samba ain't good ol' Windows P2P-style  networking where you can just turn it on and share things... to use Samba - you will need to create shares on the server and then grant access to users / groups or allow anonymous [on a home network -- you'd be ok with this] access. 


If your box is publicly accessible -- you dont want to just allow everyone wholesale access -- you'll want to lock ti down a bit more... 

My initial guess: you need to go into your Samba configuration and set it up to allow users on your local network access... 

If you are new to Samba and windows/Unix networking -- you might want to install and run "SWAT" -- a web based tool to manage your Samba shares...


----------



## mbr661 (Dec 31, 2010)

*Trying to set up a Samba file server*

Hello TooLSHeD,

Let me recomment this book to you, it will help you install samba in your FreeBSD box in minutes.

Building a Server with FreeBSD 7
By: Bryan J. Hong

Cheers!


----------



## TooLSHeD (Dec 31, 2010)

Hi

I pretty much solved the problem right after posting the message, I created a Samba user with `smbpasswd -a` and also set encrypt passwords to yes.



> Every site? Did you read the official documentation?


Yup, went through that too.



> If your box is publicly accessible -- you dont want to just allow everyone wholesale access -- you'll want to lock ti down a bit more...


I've set the allowable hosts in the conf file to only the few machines in our network. Is that enough?

Thanks


----------



## codeWarrior (Dec 31, 2010)

*Easy way for you to manage Samba*

FYI: you might want to look at installing "SWAT" -- it's a web-based interface to manage your Samba shares / Unix --:> Windows networking solution... in fact: SWAT stands for "Samba Web Administration Tool"

if you installed Samba from ports: you can simply rebuild Samba without killing your current installation by:


```
cd /usr/ports/net/samba35
make rmconfig
make config
```

Pay close attention to the menu when you make config -- Make sure you check the option to install SWAT... Then you can re-install Samba 3.5:

[CMD=""]make install -DFORCE_PKG_REGISTER"[/CMD]


----------



## wblock@ (Jan 1, 2011)

codeWarrior said:
			
		

> ```
> cd /usr/ports/net/samba35
> make rmconfig
> make config
> ```



rmconfig is not necessary.  It will reset all options to default, wiping out any changes the user had made previously.



> Pay close attention to the menu when you make config -- Make sure you check the option to install SWAT... Then you can re-install Samba 3.5:
> 
> [CMD=""]make install -DFORCE_PKG_REGISTER"[/CMD]



make reinstall is less typing.  But I'd suggest backing up the config files from /usr/local/etc/ and using
`# make deinstall install`


----------



## TooLSHeD (Jan 2, 2011)

Hi

Thanks for all the help, I've got SWAT up and running already. Everything seems to be working well, but after I set up 3 drives as a raidz array, things are copying painfully slow. I'm just playing around with the zfs tuning.

Thanks


----------



## jimv (Jan 4, 2011)

The book's website: http://nostarch.com/freebsdserver.htm



			
				mbr661 said:
			
		

> Hello TooLSHeD,
> 
> Let me recomment this book to you, it will help you install samba in your FreeBSD box in minutes.
> 
> ...


----------

