Here's how to setup Samba file sharing service on FreeBSD server:
- Install Samba port, using portmanager with logging to /var/log/portmanager.log :
portmanager net/samba3 -l
- Edit and append the below into Samba configuration file, /usr/local/etc/smb.conf :
[newshare] path=/media/samba browseable=yes writeable=yes valid users = @general admin users = joeThe above configuration will create a new Samba share, named "newshare", in the FreeBSD file system path of "/media/samba". It sets the samba share (newshare) as browseable & writable, when using a Samba friendly file manager. E.g. KDE's Konqueror, GNOME'S Nautilus, OSX Finder.
This share "newshare" will be allow to access from all users of group "@general" & user "joe" will be able to create, change & delete it's contents.
- Add a FreeBSD group, named "general" :
pw groupadd general
- Add a FreeBSD user, named "joe" :
adduserThen answering the prompts on new user information
- Add a Samba User, preferably same as the previous step, named "joe" :
smbpasswd -a joeThe "smbpasswd" file will be created if it doesn't exist in /usr/local/etc/samba/. Do take note that the Samba configuration file (smb.conf) will still reside in /usr/loca/etc/.
- Configure rc to allow Samba file sharing service to be started :
echo smbd_enable=\"YES\" >> /etc/rc.conf echo nmbd_enable=\"YES\" >> /etc/rc.conf echo winbindd_enable=\"YES\" >> /etc/rc.conf
- Finally, start the Samba file sharing service :
This is a quick way of getting Samba file sharing up & running but Samba has so much more powerful features. Do refer to Samba's official Documentation for more functions & features.
Das Vidanya !!!