Configuring Samba 3.0 to act as a Windows File Server

One of the most common roles for a Linux server on a predominately Windows network is as a file and printer server. The effectively free price of Linux makes it a very attractive alternative to the Windows server family. To act as a Windows file and printer server, Linux requires the Samba package, which implements the Windows file and printer sharing protocol (known as SMB or CIFS) under Linux/UNIX.

Installing Samba

A copy of Samba 3.0.0 is included on the PC World January 2004 cover CD. Your Linux distribution may include a copy of an earlier version. Unless you want to use the advanced Active Directory features included in Samba 3.0.0, the version included with your distribution is suitable to perform the tasks outlined in this article.

To compile Samba from the cover CD, copy it to your hard drive and type the following in a shell:

Once Samba has built, you will need to become the super user (if you are not already logged in as root) by typing ‘su’ and entering the root password. To install your freshly compiled copy of Samba, type the following:

$ make install

Configuring Samba

Samba uses plain text configuration files. The default version of each configuration file is loaded with helpful explanations of each setting and is well worth reading before making changes. The Samba configuration files are commonly located in /etc/samba/ or /usr/local/samba/lib/, but your distribution may place them elsewhere. The configuration file you need to edit is named smb.conf. Here is an example of an smb.conf file which will share a single directory on your Windows network. (Line numbers have been added to aid explanation; be sure to remove them if you copy the example into your own configuration file.)

The first section of the smb.conf is the global configuration, as indicated by the header on line 1. In this section you can define settings, for example, the workgroup to which the server belongs (line 2), and the name attributed to the computer when listed on the network (line 3).
Shared drives can be defined after the global section. Each shared drive must be given a name, such as share1 (line 4). Line 5 is a comment describing the purpose of the share. Line 6 specifies the path that will be shared under this share. Line 7 allows the share to be mounted without the need to enter a password.

Once you have tweaked your con­figuration settings in smb.conf, it is important to test them with the testparm program. Type the following in a shell to verify your configuration settings:

$ testparam /etc/samba/smb.conf

To start the Samba server, as root type the following in a shell:

/etc/init.d/samba start

You should now be able to see your Linux computer on your Windows network when exploring the Network Neighbourhood.

If you have trouble connecting to your Samba server because of a bad password, you will need to add a user to your Samba password file. To do this, type:

$ smbpasswd -a

You will be prompted to enter the password for the user twice before the account is created. Creating a Samba user requires a user with the same name that already exists on your Linux computer.

Browsing Windows servers under Linux

Samba also includes a handy client, creatively named smbclient, which can be used to test your Samba server or to browse other Windows servers. To connect to a Windows server using smbclient, type the following:

$ smbclient //servername/sharename -U username

Change username to a working system login for the computer you are connecting to. After connecting you will be greeted with a prompt similar to:

The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Reproduction in whole or in part in any form or medium without express written permission of IDG Communications is prohibited. Copyright 2013 IDG Communications.
ABN 14 001 592 650. All rights reserved.

Contact Us

With over 25 years of brand awareness and credibility, Good Gear Guide (formerly PC World Australia), consistently delivers editorial excellence through award-winning content and trusted product reviews.