Install samba by Ports
A Samba server is a Windows shared folder server that allows you to share a directory on your FreeBSD server with your networked Windows computers. For this guide I’m only going to show you how to set it up and make a publicly accessible folder because frankly I don’t understand how to do some of the more advanced user creation and management. The first thing you’re going to need to do is install the Samba port, then you configure it, then you start it. It’s really quite easy once you get the feel for the FreeBSD Ports system structure. Installing Samba From a Port Step 1: the following into your shell prompt to change your directory to the samba 3 ports directory: [john@freebsd /]$ cd /usr/ports/net/samba3 Step 2:Type the following into your shell prompt to install the samba port: [john@freebsd /]$ sudo make install With any luck samba is now installed, but installation is only half the battle… Configuring it can be difficult but we’re going to go with the simplest configuration possible to get a publicly accessible folder on your network. From there you can seek more advanced resources for user control and printer sharing. Configuring Samba After Installation Step 1: Type the following into the command prompt to copy the default configuration file to the usr/local/etc directory: [john@freebsd /]$ sudo cp /usr/local/share/examples/samba/smb.conf.default /usr/local/etc/smb.conf Step 2: Now change your directory to /usr/local/etc: [john@freebsd /]$ cd /usr/local/etc/smb.conf Step 3: Now open up your configuration file in pico: [john@freebsd /]$ sudo pico smb.comf Step 4: Find the line that says “workgroup = MYGROUP” and change it to whatever your workgroup is. The default Windows workgroup is “WORKGROUP”, so I changed mine to “workgroup = WORKGROUP”. Step 5: Find the line that says “security = user” and change it to “security = share”, this will make your share somewhat less secure, but much easier to configure and you’ll be limiting by IP address anyway. Step 6: Find the line that says “; hosts allow = 192.168.1. 192.168.2. 127.” and uncomment it to look like “hosts allow = 192.168.1. 192.168.2. 127.”. This will limit the access to your share to local computers only, if you’d like it to be even more secure you can just add specific IPs to the list. Step 7: Find this block: ;[public] ; path = /usr/somewhere/else/public ; public = yes ; only guest = yes ; writable = yes ; printable = no and change it to: [public] path = /usr/home/john/share public = yes only guest = yes writable = yes printable = no Step 8: Close and save the file with Ctrl+X, then type “y” then hit enter to save over the file. You should now have a properly configured Samba server… Create the directory. You need to make the directory and change the ownership to make it writable. Create Folder Step 1: Type this into the command line: [john@freebsd /]$ mkdir /usr/home/john/shared. Step 2: Change the ownership to “nobody” by typing this in the commandline: [john@freebsd /]$ sudo chown nobody /usr/home/john/shared Last step, start the server. Start the Server Step 1: Type this into the command prompt: [john@freebsd /]$ sudo pico /etc/rc.conf Step 2: Find this line sshdenable=”YES” and add under it sambaenable=”YES”. Step 3: Close and save the file with Ctrl+X, then type “y” then hit enter to save over the file. Step 4: Now you can start the Samba server with: [john@freebsd /]$ /usr/local/etc/rc.d/samba start. Yeesh that was long… You should be able to get on your Windows computer and look in your network places and use your Samba share like any other Windows share. I’m sure I’ll have to revise this so if something breaks let me know.















