<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; smb.conf</title> <atom:link href="http://www.ghacks.net/tag/smbconf/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Connect to a Samba share from OS X</title><link>http://www.ghacks.net/2010/03/16/connect-to-a-samba-share-from-os-x/</link> <comments>http://www.ghacks.net/2010/03/16/connect-to-a-samba-share-from-os-x/#comments</comments> <pubDate>Mon, 15 Mar 2010 23:14:03 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Mac]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[finder]]></category> <category><![CDATA[samba]]></category> <category><![CDATA[smb.conf]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=23712</guid> <description><![CDATA[Here on Ghacks I&#8217;ve worked to cover Samba from numerous angles (check out the Samba Topic on Ghacks). I want to build on that topic by helping you to connect to a Samba share from within the OS X operating system. And just in case your Samba install is not set up, or just not [...]]]></description> <content:encoded><![CDATA[<p>Here on Ghacks I&#8217;ve worked to cover Samba from numerous angles (check out the <a
title="Samba On Ghacks" href="http://www.ghacks.net/index.php?s=samba" target="_blank">Samba Topic on Ghacks</a>). I want to build on that topic by helping you to connect to a Samba share from within the OS X operating system. And just in case your Samba install is not set up, or just not quite right, I will offer up an easy to use <strong>smb.conf</strong> file that should help you get things rolling.</p><p>For this installation I will using Samba on a Debian server. Nothing really special, but it is on a fairly secure internal network (So I won&#8217;t really touch on security in this article). With that said, let&#8217;s begin.</p><p><span
id="more-23712"></span><strong>smb.conf</strong></p><p>First let me show you a simple, easy to use, <strong>smb.conf</strong> file. This file should be placed in <strong>/etc/samba/ </strong>AFTER you back up your current <strong>/etc/samba/smb.conf </strong>file with the command <em>cp /etc/samba/smb.conf /etc/samba/smb.conf.bak</em>. Once you have that done, open up <strong>/etc/samba/smb.conf</strong>, delete the contents of that file, and insert the following:</p><p>﻿[global]<br
/> netbios name = <strong>NETBIOS_NAME</strong><br
/> workgroup = <strong>WORKGROUP</strong><br
/> security = user<br
/> encrypt passwords = yes<br
/> smb passwd file = /etc/samba/smbpasswd<br
/> interfaces = <strong>192.168.1.1/8</strong><br
/> <code><strong><span
style="font-weight: normal">[</span>SHARE</strong>]<br
/> comment = <strong>COMMENT</strong><br
/> path = <strong>/PATH/TO/SHARE</strong><br
/> writeable = yes<br
/> create mode = 0750<br
/> locking = yes</code></p><p>Where everything in <strong>BOLD</strong> is user/network specific.</p><p><strong>Passwords and users</strong></p><p>Now of course you have to add users and add passwords for them. Do the following:</p><p><em>sudo smbpasswd -L -a <strong>USERNAME</strong></em></p><p>Where <strong>USERNAME </strong>is the actual name of the user you want to add. You will be prompted to create a password and retype said password.</p><p>Now enable the user with the command:</p><p><em>sudo smbpasswd -L -e <strong>USERNAME</strong></em></p><p>Again, where <strong>USERNAME </strong>is the actual user name you want to add.</p><p>Now restart Samba with the command:</p><p><em>/etc/init.d/samba restart</em></p><p><strong>Connect from OS X</strong></p><div
id="attachment_23713" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/03/mac_samba.png"><img
class="size-medium wp-image-23713 " src="http://www.ghacks.net/wp-content/uploads/2010/03/mac_samba-500x264.png" alt="" width="300" height="158" /></a><p
class="wp-caption-text">Figure 1</p></div><p>And now to the heart of the matter. How do you connect to your Samba server from OS X? Here&#8217;s how. The first step is to open up the Finder. Once the finder window is open click the &lt;Apple&gt;k key combination which will bring up the window you see in Figure 1.</p><p>If this is your first time to connect to this Samba server from your Mac, you won&#8217;t see the servers listed&#8230;you will have to manually enter them. As you can see, in Figure 1, the address to enter is in the form: <em>smb://IP_ADDRESS_OF_SERVER. </em></p><div
id="attachment_23714" class="wp-caption alignright" style="width: 276px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/03/mac_samba3.png"><img
class="size-full wp-image-23714 " src="http://www.ghacks.net/wp-content/uploads/2010/03/mac_samba3.png" alt="" width="266" height="213" /></a><p
class="wp-caption-text">Figure 2</p></div><p>Once you enter the IP address hit the Connect button and you will be prompted to select the SMB/CIFS share you want to connect to. After you do this the authentication window will open (see Figure 2). In this window you will be required to enter the Samba credentials for the Samba server.</p><div
id="attachment_23715" class="wp-caption alignleft" style="width: 208px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/03/mac_samba4.png"><img
class="size-full wp-image-23715" src="http://www.ghacks.net/wp-content/uploads/2010/03/mac_samba4.png" alt="" width="198" height="179" /></a><p
class="wp-caption-text">Figure 3</p></div><p>Upon authentication to the Samba Server the Share will mount and appear in your Finder as you see in Figure 3 (only the share name will be different). You can now navigate this share as you would any folder.</p><p><strong>Disconnecting from the share</strong></p><p>Once you are finished using the share you can unmount the share by clicking the upward pointing arrow associated with the share listing in Finder. Of course you can leave this share mounted until you reboot the machine. I would suggest umounting the share before your reboot or shutdown.</p><p><strong>Final thoughts</strong></p><p>Mac and Linux do play well together. Hopefully you have found connecting to a Samba server as simple as nearly any other task in OS X.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/03/16/connect-to-a-samba-share-from-os-x/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Configure Samba with Gadmin-Samba</title><link>http://www.ghacks.net/2009/12/25/configure-samba-with-gadmin-samba/</link> <comments>http://www.ghacks.net/2009/12/25/configure-samba-with-gadmin-samba/#comments</comments> <pubDate>Fri, 25 Dec 2009 16:58:55 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[CIFS]]></category> <category><![CDATA[gadmin]]></category> <category><![CDATA[samba]]></category> <category><![CDATA[shares]]></category> <category><![CDATA[SMB]]></category> <category><![CDATA[smb.conf]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[ubuntu server]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=21799</guid> <description><![CDATA[For those new to Samba, the configuration of this provider of seamless file and print services to SMB/CIFS clients can sometimes be a nightmare. Not only are you dealing with tricky configuration files, you also have to worry about getting users added to encrypted password files. Of course if you want to tackle this the old-school [...]]]></description> <content:encoded><![CDATA[<p>For those new to Samba, the configuration of this provider of seamless file and print services to SMB/CIFS clients can sometimes be a nightmare. Not only are you dealing with tricky configuration files, you also have to worry about getting users added to encrypted password files. Of course if you want to tackle this the old-school way you can take a read of my article &#8220;<a
title="Set up your Ubuntu server as a Samba server" href="http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/" target="_blank">Set up your new Ubuntu server as a Samba server</a>&#8220;. But for those that prefer to do things the GUI way, there are plenty of tools available for you as well.</p><p>One such tool is the gadmin-samba tool from the Gadmintools suite of GUI Linux administration tools. The Gadmintools suite allows you to easily setup Samba with the help of a well thought-out graphical interface. With this tool you should be able to have Samba up and running in no time. Of course, there is a bit of installation to tackle at first, but even that is simple. So, without further adieu, let&#8217;s get to work.</p><p><span
id="more-21799"></span><strong>Installation</strong></p><p>You can do this two ways:</p><ul><li>Install the entire Gadmin suite of tools.</li><li>Install only the Samba tool.</li></ul><p>You will also need to make sure Samba is installed as well as winbind. So open up Synaptic and search for the following:</p><ul><li>samba</li><li>winbind</li><li>gadmin-samba</li></ul><p>Mark each of those for installation and they should pick up all of the necessary dependencies. Once installed, you are ready to rock.</p><p><strong>Running Gadmin-Samba</strong></p><div
id="attachment_21800" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/12/gadmin_samba.png"><img
class="size-medium wp-image-21800 " src="http://www.ghacks.net/wp-content/uploads/2009/12/gadmin_samba-500x346.png" alt="" width="300" height="208" /></a><p
class="wp-caption-text">Figure 1</p></div><p>To start the tool go to the System Tools sub-menu of the Applications menu and select Gadmin Samba. You will have to enter your sudo (or root user &#8211; depending upon your distribution) password. The main window will open with no configuration settings filled in (see Figure 1).</p><p>I will go through the setup one tab at a time.</p><p><strong>Server settings</strong></p><p>Although there are numerous settings to configure, you really only need configure a few of these to get a basic Samba server up and running.</p><ul><li>The servers host name: This is actually the Netbios name as configured in smb.conf.</li><li>Workgroup: The workgroup your Samba server will be a part of.</li><li>Security level: Setting this according to your needs (I prefer users on a smaller network).</li><li>Allowed hosts and networks: Set this to <em>eth0 lo</em> (you might have to modify <em>eth0</em> to reflect your network device name).</li></ul><p>That&#8217;s it for this tab. Now we move on to the users tab.</p><p><strong>Users</strong></p><div
id="attachment_21801" class="wp-caption alignright" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/12/gadmin_samba_users.png"><img
class="size-medium wp-image-21801 " src="http://www.ghacks.net/wp-content/uploads/2009/12/gadmin_samba_users-500x346.png" alt="" width="300" height="208" /></a><p
class="wp-caption-text">Figure 2</p></div><p>The Users tab is exactly what you would expect &#8211; a means to set up users for your Samba share. This section takes the place of having to use the <em>smbpasswd </em>command. From this tab (see Figure 2) you will need to fill out:</p><ul><li>Username: The name of the user.</li><li>Password: The password for the user.</li><li>Group: You must add your user to a group. You can safely add your user to the same name as the username. So if your username is joe, you can add this user to the joe group.</li><li>Comment: For some odd reason, comments are required.</li><li>Home directory. Set this to the users&#8217; home directory.</li><li>Shell: Most likely this will be /bin/sh</li></ul><p>After you fill out this information click the Apply button. You are now ready to move on to the Shares tab.</p><p><strong>Shares</strong></p><div
id="attachment_21802" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/12/gadmin_samba_shares.png"><img
class="size-medium wp-image-21802 " src="http://www.ghacks.net/wp-content/uploads/2009/12/gadmin_samba_shares-500x346.png" alt="" width="300" height="208" /></a><p
class="wp-caption-text">Figure 3</p></div><p>When you click on the Shares tab you might be surprised to see some default values in place. If not, don&#8217;t worry, this is simple. Just configure the following:</p><ul><li>Share name: The name of the share you want to create.</li><li>Shared directory: The directory you want to share out. By default, Gadmin Samba will want to share out <strong>/opt/samba</strong>. This is fine if you like, but you must remember that your normal users will not have write permission to this directory. That&#8217;s okay, you can add users to this directory by scrolling down and clicking the &#8220;Add access permissions&#8221; button and walking through the wizard. Just use caution with this. If you add users to the share, only those users will have access to the share. This is good security, but you must remember to add new users to this share should new users need access.</li></ul><p>Once you have configured your users, you can click on the Configuration tab to see what your <strong>/etc/samba/smb.conf</strong> file will look like and click the Save button should it suffice. Once you have saved your configuration file, click the Activate button and Samba will up and running, ready for your users to connect.</p><p><strong>Final thoughts</strong></p><p>The Gadmintools Samba GUI has taken the complexity out of setting up a Samba server. Give this tool a try and see if you can&#8217;t get your Samba server up and running faster and with less hair pulling than you ever did with your manual setups.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/12/25/configure-samba-with-gadmin-samba/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Connect to your Samba server from Linux</title><link>http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/</link> <comments>http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/#comments</comments> <pubDate>Tue, 03 Nov 2009 23:03:42 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[samba]]></category> <category><![CDATA[samba shares]]></category> <category><![CDATA[smb.conf]]></category> <category><![CDATA[smbclient]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=18072</guid> <description><![CDATA[I have written a few articles on Samba here on Ghacks. And most people know how to connect to Samba shares via Windows. Generally speaking (when all is set up correctly) it&#8217;s just a matter of opening up Explorer and entering \\ADDRESS_OF_SAMBA_SERVER\SHARENAME to get to your Samba shares. But what about in Linux? How do [...]]]></description> <content:encoded><![CDATA[<p>I have written a few articles on Samba here on Ghacks. And most people know how to connect to Samba shares via Windows. Generally speaking (when all is set up correctly) it&#8217;s just a matter of opening up Explorer and entering \\ADDRESS_OF_SAMBA_SERVER\SHARENAME to get to your Samba shares. But what about in Linux? How do you go about connecting to Samba shares with the same operating system that is running the Samba server?</p><p>One would think that an easy task. It actually is, once you know how it is done.  And in this article I am going to show you two different ways of making the connection to your Samba server. You will need to have a working knowledge of how the Samba server is set up as well as a username/password configured on the Samba server. There are also a few steps to take on the desktop for one certain method of connection.</p><p>The two methods I will describe are: Using GNOME&#8217;s Connect To Server dialog and the command line. The latter will be used to show you how to set up auto mounting for Samba.</p><p><span
id="more-18072"></span></p><p><strong>The graphical method</strong></p><div
id="attachment_18074" class="wp-caption alignleft" style="width: 190px"><a
rel="attachment wp-att-18074" href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/connect_to_server/"><img
class="size-thumbnail wp-image-18074 " src="http://www.ghacks.net/wp-content/uploads/2009/11/connect_to_server-300x300.png" alt="Figure 1" width="180" height="180" /></a><p
class="wp-caption-text">Figure 1</p></div><p>If you take a look at the GNOME Places menu you will see an entry labeled &#8220;Connect to server&#8230;&#8221;. This is what you want to use in order to connect to your Samba server. When you click on that a new window will open. From the Service type drop-down select &#8220;Windows share&#8221; (see Figure 1).</p><p>When you select that entry some of the configuration options will change. As you can see (in Figure 1), I have entered the necessary options to connect to a Samba server on my internal network. You will want to replace the information so it reflects your needs. The only tricky bit of information might be the Folder entry. If you are connecting to the root directory on the share you will not need to enter anything there. Say, for instance, you share is <strong>/media/samba/user<em>. </em><span
style="font-weight: normal">If you want to connect to that directory leave the Folder entry blank. Say, however, you want to connect directly to a sub-folder within that share &#8211; you can enter that folder here. This, of course, isn&#8217;t needed because you can always traverse the sub-directories with simple navigation. <span
style="background-color: #ffffff"><strong><span
style="font-weight: normal">You can also choose to add a bookmark instantly, from in this window. </span></strong></span></span></strong></p><p><strong><span
style="font-weight: normal"><span
style="background-color: #ffffff"><strong><span
style="font-weight: normal"> </span></strong></span></span></strong></p><p><strong><strong> </strong></strong></p><p><strong><strong> </strong></strong></p><div
id="attachment_18075" class="wp-caption alignright" style="width: 190px"><a
rel="attachment wp-att-18075" href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/connect_to_server_password/"><img
class="size-thumbnail wp-image-18075 " src="http://www.ghacks.net/wp-content/uploads/2009/11/connect_to_server_password-300x300.png" alt="Figure 2" width="180" height="180" /></a><p
class="wp-caption-text">Figure 2</p></div><p>Once you have all of the information entered click Connect and you will be greeted with a new window that requires you to enter a password. Also, if you do not supply a Domain name in the previous window, you will be required to enter it here.</p><p>You can also set this up to remember your password either until you logout or until, well, forever. Once you have entered the password/domain click the Connect button and a new Nautilus window will open inside of your Samba Share.</p><p><strong>Using the command line</strong></p><p>Now we&#8217;re going to use the command line to accomplish a similar goal. The biggest difference is that we are going to actually mount the Samba share into another directory, very much the same way we would mount a second hard drive.</p><p>There are a few pieces to put together before we actually take care of the mounting. First let&#8217;s create a directory that the Samba share will be mounted to. So from the terminal window issue the following command:</p><p><em>sudo mkdir /media/samba</em></p><p>Now let&#8217;s make sure our users can read/write to this directory with the command:</p><p><em>sudo chmod -R u+rw /media/samba</em></p><p>Okay now let&#8217;s make sure we can see the Samba shares from the command line. We&#8217;ll do that with the <em>smbclient </em>command like so:</p><p><em>smbclient -L //SAMBA_SERVER_ADDRESS</em></p><p>Where <em>SAMBA_SERVER_ADDRESS</em> is the actual IP address of the Samba server.</p><div
id="attachment_18089" class="wp-caption alignleft" style="width: 190px"><a
rel="attachment wp-att-18089" href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/smbclient/"><img
class="size-thumbnail wp-image-18089 " src="http://www.ghacks.net/wp-content/uploads/2009/11/smbclient-300x300.png" alt="Figure 3" width="180" height="180" /></a><p
class="wp-caption-text">Figure 3</p></div><p>You will be prompted for your username and password. If you get an error it could be that the usernames don&#8217;t match on each end. If that&#8217;s the case you could add the <em>-U </em>switch to the command like so:</p><p><em>smbclient &#8211;user=jlwallen -L  //SAMBA_SERVER_ADDRESS</em></p><p>You should see output similar to that shown in Figure 3.</p><p>Now it&#8217;s time to try to mount the Samba share to the <strong>/media/samba</strong> directory. To do this issue the command:</p><p><em>sudo mount -t cifs //SAMBA_SERVER_ADDRESS/SHARE -o username=USERNAME /media/samba/</em></p><p>Where:</p><ul><li><span
style="background-color: #ffffff">SAMBA_SERVER_ADDRESS is the IP address of the Samba server.</span></li><li><span
style="background-color: #ffffff">SHARE is the share name.</span></li><li><span
style="background-color: #ffffff">USERNAME is the username to connect with.</span></li></ul><p>If that works you can now make this an automated mount by adding the following line to your <strong>/etc/fstab</strong> file:</p><p><code>//SAMBA_SERVER_ADDRESS/SHARE     /media/samba    cifs  credentials=/etc/samba/user.cred 0 0 </code></p><p>Where SAMBA_SERVER_ADDRESS is the IP address of the Samba server and SHARE is the share name.</p><p>Notice the user.cred file. This is one last thing we need to create. With your text editor create this file and place into it:</p><p><em>username=USER</em></p><p><em>password=PASSWORD</em></p><p>Where USER is the username to log in with and PASSWORD is the password to use for authentication. The final step is the give this new file the proper permissions with the command:</p><p>sudo chmod 600 /etc/samba/user.cred</p><p>You can ensure this works by issuing the command <em>mount -a</em> which should mount your Samba share.</p><p><strong>Final thoughts</strong></p><p>You should now have an auto-mounting Samba share &#8211; or the ability to easily connect your GNOME desktop to a Samba share. Samba is a very powerful tool that not only can share files with Windows machines, but with Linux machines as well.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Set up your new Ubuntu Server as a Samba Server</title><link>http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/</link> <comments>http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/#comments</comments> <pubDate>Fri, 04 Sep 2009 16:58:23 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[file-sharing]]></category> <category><![CDATA[samba]]></category> <category><![CDATA[samba server]]></category> <category><![CDATA[smb.conf]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=16023</guid> <description><![CDATA[I recently did an illustrated guide to installing Ubuntu Server 9.04 (&#8220;Installing Ubuntu Server 9.04&#8220;). I did that for two reasons: 1) It was requested and 2) It will serve as a base for future articles that will cover many different topics. Having that foundation will be key to getting other services up and running. [...]]]></description> <content:encoded><![CDATA[<p>I recently did an illustrated guide to installing Ubuntu Server 9.04 (&#8220;<a
title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8220;). I did that for two reasons: 1) It was requested and 2) It will serve as a base for future articles that will cover many different topics. Having that foundation will be key to getting other services up and running.</p><p>In this article I am going to show you how to get a basic Samba Server up and running on top of that Ubuntu Server. Now, because the Ubuntu Server was set up as a headless server, the installation and configuration of Samba will be done completely from the command line. So get your fingers ready to type.</p><p><span
id="more-16023"></span><strong>What is Samba?</strong></p><p>Samba is a very handy tool that can do many things. The primary task it serves is to enable a Windows machine to access a Linux machine serving as a file and/or print server. Samba uses the SMB/CIFS protocols to enable communication between the Windows and the Linux machine.</p><p>Samba has often been thought of as very difficult to get up and running. It&#8217;s not really that bad. Hopefully, by the end of this article, you will have a fairly good understanding of how to get it up and running.</p><p><strong>Installing Samba</strong></p><p>As I said, you will doing this completely from the command line. The command to issue is:</p><p><em>sudo apt-get install samba</em></p><p>You will have to enter your sudo password to continue with the installation. Depending upon your server installation, you might have to okay some dependencies. Go ahead and do this and then watch as Samba is installed.</p><p>Once installed you will have the Samba executable in <strong>/etc/init.d/</strong>. In order to start Samba you will issue the command:</p><p><em>/etc/init.d/samba star</em><em>t</em></p><p>Of course, before you start Samba, you will need to configure Samba. There are a few steps to take care of. Let&#8217;s first deal with the configuration file.</p><p><strong>Configuring Samba</strong></p><p>Before you get too deep into this you might want to first read my article &#8220;<a
title="Understanding smb.conf" href="http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/" target="_blank">Get To Know Linux: Understanding smb.conf</a>&#8220;. The Samba configuration file is located in the <strong>/etc</strong><strong>/samba</strong> directory and is called <strong>smb.conf</strong>. When you first open up this file you may be overwhelmed. Let&#8217;s avoid that by making a backup of the original <strong>smb.conf </strong>file. Change to the <strong>/etc/samba</strong> directory with the command:</p><p><em>cd /etc/samba</em></p><p>Now issue the following command:</p><p><span
style="background-color: #ffffff"><em>sudo cp smb.con smb.conf.bak</em></span></p><p><span
style="background-color: #ffffff">Now you can open up the <strong>smb.conf</strong> file and erase the entirety of its contents. How do you do that? If you are using the Nano editor it&#8217;s simple. With the file open hold the Ctrl key and the &#8216;K&#8217; key down until the entire contents are gone. Or you can delete the file and create a new one. Your choice.</span></p><p><span
style="background-color: #ffffff">With a fresh <strong>smb.conf </strong>you are ready to re-create a file based on your needs. A good configuration to start with looks like:</span></p><p><code>[global]<br
/> netbios name = NETBIOS_NAME<br
/> workgroup = WORKGROUP_NAME<br
/> security = user<br
/> encrypt passwords = yes<br
/> smb passwd file = /etc/samba/smbpasswd<br
/> interfaces = 192.168.1.1/8</code></p><p><code>[SHARE_NAME]<br
/> comment = COMMENT<br
/> path = /PATH/TO/SHARE<br
/> writeable = yes<br
/> create mode = 0600<br
/> directory mode = 0700<br
/> locking = yes</code></p><p><span
style="background-color: #ffffff">Where everything in ALL CAPS (as well as the interfaces line) is unique to your needs.</span></p><p><span
style="background-color: #ffffff">The SHARE_NAME is what you want to share out to your users. So if you are setting up a file server for a number of users you will want to have a directory, say <strong>/data</strong>, that is shared out through Samba. </span></p><p><span
style="background-color: #ffffff">Once you have the <strong>smb.conf</strong> file configured to suit your needs you are ready for the last steps.</span></p><p><span
style="background-color: #ffffff"><strong>Adding users</strong></span></p><p><span
style="background-color: #ffffff">This is the step that most people skip and wonder why Samba isn&#8217;t working. For every user that needs to log in to the Samba server you have to add them with the help of the <em>smbpasswd </em>command. Let&#8217;s say I need to add the user &#8220;pickles&#8221;.  To add &#8220;pickles&#8221; I would issue the command:</span></p><p><span
style="background-color: #ffffff"><em>sudo smbpasswd -L -a pickles</em></span></p><p>Now to make sure the users is enabled issue the command:</p><p><em>sudo smbpasswd -L -e pickels</em></p><p>Now restart Samba with the command:</p><p><em>sudo /etc/init.d/samba restart</em></p><p>Your Samba file server should be ready to go. Go to your windows machine and the Share should be visible. Double click on that share you and you will enter the username and password combination for any one of the users on the machine (as long as they were also added with smbpasswd). If you can not see it make sure your Windows machine is set up on the Workgroup.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Get To Know Linux: Understanding smb.conf</title><link>http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/</link> <comments>http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/#comments</comments> <pubDate>Fri, 06 Feb 2009 21:16:56 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[domain]]></category> <category><![CDATA[file-sharing]]></category> <category><![CDATA[samba]]></category> <category><![CDATA[shares]]></category> <category><![CDATA[smb.conf]]></category> <category><![CDATA[workgroup]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=10373</guid> <description><![CDATA[Next to the xorg.conf file (read my Get To Know Linux: Understanding xorg.conf for more) the smb.conf file might be the most misunderstood of all files. Part of the reason for this is because the default file is, well, rather large and confusing. When you compare what you need vs what you have (in the [...]]]></description> <content:encoded><![CDATA[<p>Next to the xorg.conf file (read my <a
title="Get To Know Linux: Understanding xorg.conf" href="http://www.ghacks.net/2009/02/04/get-to-know-linux-understanding-xorgconf/" target="_blank">Get To Know Linux: Understanding xorg.conf for more</a>) the smb.conf file might be the most misunderstood of all files. Part of the reason for this is because the default file is, well, rather large and confusing. When you compare what you <strong>need</strong> vs what you <strong>have</strong> (in the default at least), you will be surprised at how simple Samba can be to configure.</p><p>After Samba is installed the smb.conf file will be around 533 lines long. Fear not. It&#8217;s much easier than it seems.</p><p><span
id="more-10373"></span></p><p>The smb.conf file is broken into sections. Each section will start with a line that looks like:</p><p>[TITLE]</p><p>Where TITLE is the actual title of the block. Each block represents either a configuration or a  share that other machines can connect to. You will, at minimum, have a global block and a single share.</p><p><strong>Global</strong></p><p>The global block is one of the more important blocks in your smb.conf file. This block defines the global configuration of your Samba server. This block begins with:</p><p><em>[global]</em></p><p>Within your blocks your configuration lines will be made up of:</p><p><em>option = value</em></p><p>statements.</p><p>The most important statements you will need in your global block are:<br
/> <code>netbios name= NAME<br
/> workgroup = WORKGROUP_NAME<br
/> security = SECURITY_TYPE<br
/> encrypt passwords = YES/NO<br
/> smb passwd file = /path/to/smbpasswd<br
/> interfaces = ALLOWED_ADDRESSES<br
/> </code><br
/> The values for each option above should be self explanatory. But there is one thing to note. If you are encrypting passwords you will need to add users (with passwords) with the smbpasswd command.<br
/> Within the global block one of the more important options is the security option. This option refers to authentication (how users will be able to log in). There are five different types of security:</p><ul><li> ADS &#8211; Active Directory Domain</li><li> Domain &#8211; User verification through NT Primary or Backup Domain</li><li> Server &#8211; Samba server passes on authentication to another server</li><li> Share &#8211; Users do not have to enter username or password (until they try to access a specific directory)</li><li> User &#8211; Users must provide valid username/password. This is the default.</li></ul><p><strong>Share Blocks</strong></p><p>The next blocks will refer to individual shares. You will need a different block for each directory you want to share to Samba users. A typical share block will look like this:<br
/> <code>[SHARE NAME]<br
/> comment = COMMENT<br
/> path = /path/to/share<br
/> writeable = YES/NO<br
/> create mode = NUMERIC VALUE<br
/> directory mode = NUMERIC VALUE<br
/> locking = YES/NO</code></p><p>Everything in caps above will be defined according to your needs. The tricky entries will be the create and directory modes. What this does is define permissions for any file created as well as the share directories. So the values will be in the form of 0700 or 0600 (depending upon your permission needs). Remember, you will need a share block for every directory you want to share out.</p><p>Naturally there are plenty of options that can be used in Samba. Many of these options will fall in the global block.</p><p><strong>Printer Block</strong></p><p>You can also define a block to share out printers. This block will start with:</p><p>[printers]</p><p>and will contain options like:<br
/> <code>comment = COMMENT<br
/> path = /PATH/TO/PRINTER/SPOOL<br
/> browseable = YES/NO<br
/> guest ok = YES/NO<br
/> writable = YES/NO<br
/> printable = YES/NO<br
/> create mode = NUMERIC VALUE</code></p><p><strong>Sample smb.conf</strong></p><p>I have an external drive that I mount to <strong>/media/music</strong> and I share out to my home network with the following <strong>smb.conf </strong>file:<br
/> <code>[global]<br
/> netbios name = MONKEYPANTZ<br
/> workgroup = MONKEYPANTZ<br
/> security = user<br
/> encrypt passwords = yes<br
/> smb passwd file = /etc/samba/smbpasswd<br
/> interfaces = 192.168.1.1/8<br
/> [wallen music]<br
/> comment = Music Library<br
/> path = /media/music<br
/> writeable = yes<br
/> create mode = 0600<br
/> directory mode = 0700<br
/> locking = yes<br
/> </code><br
/> And that&#8217;s it. That is my entire <strong>smb.conf</strong> file. Granted I am only sharing out a single directory, but it shows how simple <strong>smb.conf</strong> can be to configure.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
