Home arrow Latest Tutorials arrow Setup a FreeBSD File Server with Samba
Setup a FreeBSD File Server with Samba PDF
Friday, 26 September 2008

Here is a tutorial about configuring a File Server on FreeBSD with Samba.

Samba offers SMB/CIFS support on FreeBSD, making possible to build a File Server accessibile by your Windows computers in LAN (your FreeBSD hard drive partitions will be visible/accessible for Windows computers).

We asume you've installed FreeBSD on a machine and you've created a partition that will be shared in LAN.

Step 1. Install Samba
-----------------------------
cd /usr/ports/net/samba
make install


Step 2. Add a user to Samba
---------------------------------------
Create a FreeBSD system username:

adduser


Then add that user to Samba:

/usr/local/bin/smbpasswd -a username

If you forgot first to create a system user then you will get an error like this:

Failed to add entry for user username


Step 3. Create a configuration file for Samba
------------------------------------------------------------
Create a new /usr/local/etc/smb.conf file:

edit /usr/local/etc/smb.conf

and put the following lines:

# --------- /usr/local/etc/smb.conf ----------
[global]
netbios name = Server
workgroup = Workgroup
server string = Server
interfaces = em0
security = user
log file = /var/log/samba/%m.log
max log size = 50
load printers = No
os level = 39
preferred master = Yes
domain master = Yes
dns proxy = No
local master = Yes
wins support = yes
cups options = raw
printcap name = /etc/printcap
encrypt passwords = yes
printing =

[home]
comment = Home Directories
path=/home/%u
read only = no
writable = yes
browseable = yes
map to guest = Never
guest ok = no

[Share]
comment =  File Servers
path = /home/fileserver
writeable = yes
# ------------------------------------------------


Step 4. Start Samba services
----------------------------------------
We will not edit the script that will start Samba service, and we'll add a line in /etc/rc.conf to
start Samba at boot.

Edit script that will start Samba service,

edit /usr/local/etc/rc.d/samba

and change from samba_enable:=NO to samba_enable:=YES.

Edit /etc/rc.conf and add the following line (to start Samba at boot):
samba_enable="YES"


Last Updated ( Wednesday, 04 August 2010 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?