#11 Samba 3 on FreeBSD

Here is a quick and dirty way to install Samba 3 on FreeBSD and use FreeBSD’s drive space as a network drive in Windows.

First, install Samba.

cd /usr/ports/net/samba3
make all install clean && rehash

After the installation, edit /etc/rc.conf and add the following line:


Now, copy the original file with:

cd /usr/local/etc
cp smb.conf smb.conf.orig

and add the following at the very end of the smb.conf.

comment = Kliment’s Folder
path = /usr/home/klimenta
valid users = klimenta
public = no
writable = yes
printable = no

I am using klimenta as username for both FreeBSD and Windows, although my Windows account is domain account and my Samba configuration creates a workgroup called MYGROUP. Next, add the user klimenta as a Samba user using:

smbpasswd -a klimenta

It will prompt you to create a password and confirm it. Make sure you use the same password for both Windows and FreeBSD. Option -a means that you are adding a new user. If you use smbpasswd klimenta only, it will change the password for the existing user. Now, start Samba using:

sh /usr/local/etc/rc.d/samba start

and then from Windows try:

Z:\>net use Q: \\\klimenta /persistent:yes
The command completed successfully. 

This will permanently map your FreeBSD home folder as Q: drive on the Windows box. The IP is the IP of my FreeBSD box.

UPDATE:If you want to access a Windows share from the Samba server, then you have to edit smb.conf and change the value of workgroup parameter to match your NetBIOS domain name. In my case, workgroup = ANDREEV. I restarted the Samba server and from my FreeBSD box I was able to list the shares on my Windows computer using

smbclient -L \\bigbeat -U klimenta 

and then

mount_smbfs -W ANDREEV //klimenta@bigbeat/L$ /mnt 
#101 FreeBSD: Install Atlassian Jira
#125 ssh, RDP: Bypass your corporate firewall
#94 Amazon AWS: Elastic File System (EFS) on FreeBSD/RHEL/CentOS/AWS Linux
There are currently no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.