Setting up Samba on Ubuntu LTS 8.04 Hardy Heron

Installing Samba

The first thing to do if you havn’t done so already, is install samba and the associate tools. To install samba on Ubuntu Hardy Heron (I’m assuming of course that your linux box is connected to the internet). Type the following in a terminal.

To mount Windows filesystems using SMB, you will also need to install smbfs, to do this enter the command:

Creating Samba User

There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.

Next, we’ll add that username to the smbusers file.

Add in the following line, substituting the username with the one you want to give access to. The format is < ubuntuusename >= “< samba username >”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

Now you can create samba shares and give access to the users that you listed here.

Creating Samba Shares

I want to create a shares that can be accessed by everyone on my network called “Shared”, of course you will have to login with “guest” (no password required) to get access. Also everyone who has a samba account can get access to there own files (See above “Creating Samba Users”). Remember that everytime you change your smb.conf you will need to restart samba on your server, to do this you will need to type the following at the terminal.

First of all, create a copy of the original samba config file and call it smb.conf.old. It’s always handy to have a copy of the original file just in case it all goes a bit wrong.

You need to edit my smb.conf file, to do this, type the following in a terminal.

Remember that everytime you change your smb.conf file, you will need to restart samba. You do this by typing the following in a terminal window.

New 11/7/2011 after running samba for a while with ssh for remote login, I noticed a few strange login attempts over ssh in my /var/log/auth.log see this post. Now, I remove winbind on all my internet facing workstations (one’s running ssh or apache or  mail etc…)

My smb.conf is below:

References:

The Official Samba 3.2 Howto and reference guide
Creating a samba user on Ubuntu
Samba/Configure a Workgroup from the Shell

Setting up Vista Home Premium to access Samba

What I want to do is be able to logon to my home samba server in one of 2 ways, either by mapping the drive or by going through Network Neighbourhood (Network in Vista). After reading a bit about Vista Home Premium, I found that the only way to map the drive was to either.

  1. Ensure that your  Vista login, username and password are the same as your Samba server.
  2. Don’t have a windows login password but map the drives using a small Visual Basic Script.
  3. Upgrade to Vista Business or Vista Ultimate (no way I’m paying any more money).

You can check this yourself if you wish by following the steps below (or you can take my word for it) 🙂 :

  1. Clicking on the start button (bottom Left)
  2. In the Start Search field type “User Account” then click “User Accounts” at the top of the box under programs.
  3. Under Tasks, select “Manage your Network Passwords”
  4. Click on the “Add” button. As you can see below, it’s greyed out which is just an absolute nonsence. Why they couldn’t have just added it is just beyond me.

Vista Home Premium - Stored Credential Properties

I found this vbscript that connects a network share and placed it in my startup folder.

You can do the same thing. Just create a text file in notepad, paste the code below into it. Then change the server, share, username, and password information. Don’t delete any of the commas or quotation marks. They are all needed. Save it to your startup folder. In Vista your startup folder is buried deep.

Mine is located here: C:\Users\Billy\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Yours should be the same except for the name “Billy” of course.

Here’s the code:

You can add more mapped drives by copying that last line as many times as you need.

Reference:

ScriptingAnswers.com
Tech Support People

Leave a Reply