• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Ubuntu Guide: Setup Samba File Sharing from the Terminal

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.


Senior Fold-a-holic
Sep 22, 2004
Ubuntu Guide: Setup Samba File Sharing from the Terminal

Seems like this question always comes up. How do I share my F[email protected] directory so I can monitor the client with HFM.NET? While the later versions of Ubuntu seem to have "easier" ways to enable this functionality (more point-and-click), I've always used the trusty Terminal approach in conjunction with a custom built Samba Configuration file.

This guide should be applicable to all versions of Ubuntu. However, I wrote and tested it on v9.04 since that is the most popular Folding distro at this time.

~ sudo apt-get update

~ sudo apt-get install samba

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  samba-common smbclient
Suggested packages:
  openbsd-inetd inet-superserver smbldap-tools ldb-tools smbfs
The following NEW packages will be installed:
The following packages will be upgraded:
  samba-common smbclient
2 upgraded, 1 newly installed, 0 to remove and 258 not upgraded.
Need to get 18.6MB of archives.
After this operation, 13.7MB of additional disk space will be used.
Do you want to continue [Y/n]? [B][COLOR="Yellow"](Press Enter)[/COLOR][/B]
Last thing you should see is this...
 * Starting Samba daemons                                 [ OK ]

Packages are now installed. But we aren't configured yet. Let's go ahead and stop the Samba deamon.

~ sudo /etc/init.d/samba stop

* Stopping Samba daemons                                  [ OK ]

Let's make a back-up of the smb.conf file that was laid down with the package installation. There are many good comments in this file that can teach you what each configuration options does.

~ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.template

Start gedit...

~ gedit &

Copy the text below from your browser and paste it into gedit.

Change the <workgroup> and <hostname> entries to those applicable for your network. <workgroup> should be self-explanatory, make it the same as your other machines. For this guide I chose the <hostname> ubuntu-904-vm.

Change the hosts allow entry if your subnet is not on 192.168.0. You can also comment this option (by placing a # character in the first space) if you are not concerned with restricting access based on IP address.

Once the edits are done, save the file to your home folder as smb.conf.

   workgroup = [B][COLOR="Red"]<workgroup>[/COLOR][/B]
   netbios name = [B][COLOR="Red"]<hostname>[/COLOR][/B]
   guest ok = no
   encrypt passwords = true
   hosts allow = 192.168.0.
   log file = /var/log/samba/log.%m
   max log size = 200
   security = user
   wins support = yes
   browseable = yes
   smb passwd file = /etc/samba/smbpasswd
   domain master = no
   local master = no
   preferred master = no
   os level = 34
   invalid users = root

   browseable = no
   writeable = yes

Copy the saved file to the Samba configuration directory.

~ sudo cp ~/smb.conf /etc/samba/smb.conf

Let's now add Samba users.

~ sudo smbpasswd -a <username>

The <username> is the user name you wish to use to access the Samba shares from another computer. So if you're logged into your Windows machine as user1, type user1 in place of <username>.

You'll then be prompted to enter a password. To make things seamless between Windows and Samba, enter the same password you use for your Windows user1 account.

New SMB password:
Retype new SMB password:
startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist. File successfully created.
Added user user1.

Finally, let's start the Samba deamon.

~ sudo /etc/init.d/samba start

Accessing the Ubuntu 9.04 Samba home folder share from Windows XP.

Last edited:


Sep 20, 2007
Nice Guide harlem,,, hope you are going to Add/Link to this in the Team32 Folding Guide Stickies!!

Well Done !


Senior Fold-a-holic
Sep 22, 2004
Surely and Thank You. :)

However, once this gets fully ironed out I think deadly might want to post it on the Front Page. If that's the case, then I'd rather use that link instead.


Senior whose title will pier
Mar 17, 2002
Nice, I always end up googling it. This will be most helpful.


Senior Fold-a-holic
Sep 22, 2004
I've got the Wordpress info now... so it'll get done soon. :)


Senior Member
Jan 9, 2006
For the front page, you may want a very dark color, instead of the yellow or lighter colors. With the white background on the front page, you can't see the light colors at all or very well.


Senior Fold-a-holic
Sep 22, 2004
10-4 bro... just a quick bump. I don't want to lose this thread and I have no other links to it yet. Been real busy this week, have had no OCF or HFM time. :cry:


Glorious Leader
Nov 12, 2002
Rootstown, OH
Just FYI, when you login to wordpress, and click "add new post" you get presented with some template/guidelines for formatting and stuff. This is the part of that about text:


Please stick to the default font, color, and size for all text in your article. Italic and Bold maybe used where appropriate. We encourage the use of links, especially to threads in the Forums. If you should mention a Member, please link to their profile page.

We've made exclusions for that, but typically we try to avoid the use of color whenever possible - emphasis is often best achieve thru the use of italics or bold. In some cases, <blockquote> is often useful to set part of the material apart, without using gawdy or distracting colors.