Home FreeBSD FreeBSD: Samba 3 on FreeBSD

FreeBSD: Samba 3 on FreeBSD

by Kliment Andreev
4.2K views

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:

samba_enable=”YES”

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.

[klimenta]
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: \2.168.1.111\klimenta /persistent:yes
The command completed successfully. 

This will permanently map your FreeBSD home folder as Q: drive on the Windows box. The IP 192.168.1.111 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 

Related Articles

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More