by September 6, 2001 0 comments

The advantages of having a Local Area Network are well
known. However, people have been scared away by the cost–both of the Network
Operating System (NOS) software and hardware required by these commercial

One major objective we set was to give our readers a
feasible alternative–one that doesn’t cost much and will work on mortal
hardware, while providing all the services one would expect from a proper office server.
Linux does a good job in fulfilling these objectives.

At this point we assume that you have successfully
installed Linux, using the previous article Installing Rad Hat as a guide.

We will now configure Linux box to become a file, print
and, domain/security server for your network. It isn’t very difficult–all it
takes is a bit of file editing.

Setting up a printer

Before you begin, make sure that you have installed a
printer (if you intend to use print services) and configured Linux to use it. If you didn’t
do it at the time of installation, you can do so now–just fire up X Windows
while you are logged in as root, and click the Printer icon in the Control Panel
that appears on the left side of your screen. It won’t hurt to run through the
process quickly again even if you have configured a printer–just skip the
adding stuff and go straight to the tests. If things don’t work, this is where to set
them right.

Here is a quick description of the process (we assume that
the printer is directly attached to the Linux machine):

  1. Fire up the printer configuration tool from the Control
  2. Click the Add button, and select Local Printer.
    You will get a panel showing the ports available. You have nothing to worry about unless
    every port shown is “not detected”
  3. Next you will be asked for details about the printer. Choose
    a name (you can leave the default or put in something like hplj4 if your printer is a HP
    LaserJet 4), the spool directory (leave this as the default), the file limit (leave this
    at 0 KB, indicating no limit), and the printer device (the default should be OK).
  4. Next you have to select the Input Filter. Hit that button
    and select your printer (or a close match). If your printer supports Postscript, select Postscript
    , else make sure you select a reasonably close relative of your printer.
    Some printers let you choose the desired resolution but the default is usually fine. One
    particularly nasty item can be the paper size–set it to the paper size you use most
    often, especially if you have a printer that senses the paper size. Otherwise, it might
    prompt you to insert paper matching size A4 or something similar (thereby stopping
    the print process) if you have wrong paper loaded. Finally, enable Fix Stair-stepping
    , though this option plays a role only with text that originates from a Unix
  5. When you hit OK, you get back to the Printer definition
    panel, where you should definitely select Suppress Headers unless you like a lot of
    user information printed at the beginning of every new print job!
  6. Finally, click OK, and your printer definition is over. Now you should test the new printer. Make sure paper is
    loaded and printer is online. Select the printer definition and pull down the Tests menu.

    Select Print ASCII test page and make sure
    everything is printed normally. You should not see Stair-stepping-text that
    advances to the next line but not to the beginning of the line.

    Next, test Postscript printing. Here you will see your
    first minor miracle–even if your printer is non-postscript, it will print graphics
    using Postscript! This is because the print-job is routed through the supplied utility,
    GhostScript, which converts the Postscript code into something your printer can

    If both tests are cleared, your printer is properly
    installed and you can proceed.

    Configuring for Windows networking

    Windows-style networking is probably the most common one
    today (Netware enthusiasts, don’t gnash your teeth–read Netware and Linux) and
    that’s what we are going to set up now.

    There are two kinds of Windows networking–Domain-based
    (where you have to log into the server to even see its resources) and Share-based
    (where you need to know the password for resources you wish to access). The former is the
    type of networking used by Windows NT, while the latter, also called Workgroup computing,
    is typically found in Windows for Workgroups 3.11. Each has its merits, and we do not want
    to get too deep into that now. We will assume that you want to set up Linux to offer
    Domain-based networking, complete with a security login.

    The technical name for Windows-style networking is SMB
    (Server Message Block) protocol-based networking or LanManager-style networking. Though
    Microsoft refers to it only as Windows Networking, it is actually used by many
    operating systems and architectures, including OS/2, Digital PathWorks, and so on. There
    is nothing really Microsoft or Windows specific in the protocol.

    SMB-style networking is implemented under Linux using
    Andrew Tridgell’s original implementation of the SMB protocol for Unix, called SAMBA.
    It is an extremely complex piece of work, but fortunately very easy to configure–just
    about every configuration item is stored within a single configuration file that is plain
    text, with plenty of comments included to help you along.

    This text file is called smb.conf and is found in
    the /etc directory (like just about every configuration file in Red Hat Linux-based
    systems). A few changes in that file are required to get your server up and running, so
    let’s quickly make them.

    Note: The SAMBA code originally shipped with Red Hat
    Linux 5.0 is not optimal, so we upgrade it during the installation process using the
    upgrades kit we have supplied along with our CD-ROM. If you have not yet applied those
    upgrades, you should do so now.
    The SAMBA code originally shipped with Red Hat
    Linux 5.0 is not optimal, so we upgrade it during the installation process using the
    upgrades kit we have supplied along with our CD-ROM. If you have not yet applied those
    upgrades, you should do so now.

    Here we also introduce our favorite little text editor, JOE
    (Joe’s Own Editor), and anyone who has ever used WordStar or Borland’s original
    programmer editor is going to feel right at home using it. (Why did we mention this here?
    Because, you wouldn’t believe how many people have shied away from Unix/Linux in the
    past saying “I don’t won’t to learn VI or EMACS….”.) Learn to use JOE, now, while working:
    Make sure that you are logged in as root, and issue the command joe /etc/smb.conf. This
    will fire up the editor and load configuration items.

    Go ahead, use your cursor keys to scroll and read the file.
    If you already know something about Windows Networking, you’ll see many familiar
    terms and settings.

    Now hit Ctrl-T-W. (This turns off the word-wrap
    feature that could otherwise mess up the file).

    Done? OK, now watch how easy it is to get things

    1. Scroll down and find the item workgroup =. Here your
      Windows workgroup (and also domain) is defined. The default is something like
      Mygroup. In
      your office, you probably don’t want to have a name like that for a network group, so
      let’s change it to something meaningful. Here at PC Quest Labs, we changed it
      to PCQLABS, though you could use any other name. Make sure it is eight characters or less,
      and contains no spaces. This is not a limitation of SAMBA but of some older Windows
    2. Scroll down further till you find the item security =.
      This defines whether you require a formal login into the server before shares are made
      available, or whether you just want a user to know his password for the actual shared
      resource. The default is set to security = user and you should leave it that way.
    3. Find the item called local master = and set it to yes,
      then the item os level =, which should be set to 33. The next item is domain
      master =
      which you should also set to yes. Ditto for preferred master =.
      Make sure that no semicolon (;) is given before any of these entries or the entry will be
    4. Now comes the important thing–find the item domain
      logons =
      and set it to yes.
    5. Almost there, scroll down till you find a commented-section ;[netlogon].
      Remove the semicolons from the beginning of each line in that section. Note that the path
      is shown as
      (we will need this value later).
    6. Finally, scroll down till you find a commented-section ;[tmp]
      and remove the semicolons from that section too.
    7. Now save the file and quit (Ctrl-KXI).

    We could have done more, but let’s first get these
    running. To create the netlogon directory
    (/home/netlogon), enter the command mkdir /home/netlogon. Enter chmod 0755
    to give it read and execute, but not write permissions.

    Done? OK, let’s test that using the command testparm
    | less
    . Scroll through the results and look for any error messages–if you have
    followed the above steps correctly, your shouldn’t see any. Hit q to quit the
    viewer and go back to the command prompt.

    Finally, enter the command /etc/rc.d/init.d/smb restart to
    tell the SAMBA server components to restart using this new configuration file. You should
    see the existing components being stopped and then restarted. At this point, your Linux-based file, print, and security
    server is ready for action!

    Configuring Windows clients

    To access the Linux file server, your Windows clients must
    be configured for Windows NT networking–Linux running SAMBA and configured the way we
    did emulates a Windows NT server. In fact, Windows, if asked what server it is connected
    to, will report a Microsoft Windows NT server! (If you don’t have Win 95 distribution
    on your hard disk, as is often found with pre-installed Win 95 setups, make sure you have
    your Win 95 CD-ROM or disks at hand.)

    1. In Win 95, select Start-Settings-Control Panel-Network.
    2. If you do not have Client for Microsoft Networks
      installed, click on Add-Client, Add-Microsoft, Client for Microsoft
      , and click OK.
    3. Select Client for Microsoft Networks, and click on Properties.
    4. Enable Logon to Windows NT domain, and enter the
      Domain/Workgroup name you have earlier defined in /etc/smb.conf in Windows NT
      Domain field. In our case, this was PCQLABS–you may have chosen some other name.
    5. On the same screen make sure you enable Quick logon.
      Then click on OK.
    6. Now make sure you have TCP/IP installed. If you don’t
      have, click on Add-Protocol-Add-Microsoft-TCP/IP-OK.
    7. If you have several TCP/IP entries appearing in the network
      component list, select the one pointing to your network card and click on Properties.
    8. Select IP Address. If you already have a TCP/IP-based
      network running, you will probably have a network address shown there. Since the preferred
      way of doing things is to use DHCP to obtain such information, and since we have
      configured a DHCP server (Read Configuring DHCP and DNS Services), let’s use that.
      Enable Obtain an IP address automatically.
    9. Select WINS and make sure that Use DHCP for WINS
      is checked.
    10. Select Gateway and make sure no gateways are defined
      (delete any that are shown there). You will be issued a Gateway address by the DHCP
    11. Select DNS configuration and disable DNS (don’t
      worry, DHCP will supply you with the needed values).
    12. Select Bindings and ensure that Client for
      Microsoft Networks
      is enabled.
    13. Select Advanced and make sure that this protocol is
      set as the default protocol, then click on OK.
    14. At the Network configuration screen, make sure Primary
      Network Logon
      is set to Client for Microsoft Networks.
    15. Now click the Identification tab at the top. Enter a
      unique name for your computer, and set the Workgroup to your Domain/Workgroup name (which
      we set to PCQLABS). You can also enter a short description for your computer.

    Finally, click on OK in the Network Configuration
    screen. This will probably install a number of components–some of which require the
    Windows CD-ROM/disks. When it is through, it will ask you whether it can restart your
    computer. Click on Yes after closing all applications. The machine will reboot. If all went well, you should be presented with a Network
    Logon screen, with your domain name already filled in. At this point, you need to make
    sure that you have a user account on the Linux machine. If you don’t, create one
    (while logged in as root) using the command useradd userid or use the User
    configuration applet from the Linux control panel if you have X Windows running. In either
    case, make sure that a password is assigned to the user. From the Linux command line you
    can do that with the command passwd userid. OK, now try logging in from your
    Windows machine! Enter your user ID and the password. After a brief delay, you should see
    your Windows desktop, complete with Network Neighborhood icon.

    Note: You may be prompted for a Windows password if
    this is the first time you logged in this way. Typically, the password will already be
    filled in in the first field (it uses your network login password). Do not confirm the
    password! Wipe out this pre-filled password and click on OK. This will stop Windows from
    asking you for this (effectively useless) password in the future.
    You may be prompted for a Windows password if
    this is the first time you logged in this way. Typically, the password will already be
    filled in in the first field (it uses your network login password). Do not confirm the
    password! Wipe out this pre-filled password and click on OK. This will stop Windows from
    asking you for this (effectively useless) password in the future.

    Once you are succesfully logged in, you should be able to
    see your Linux server’s name through the Network Neighborhood icon. Double click on
    that, and you should see various items, including your private home directory folder, the
    Tmp (temporary files) folder, and the printer you defined at the beginning.

    Open your personal folder. You can now copy files into it
    and use it just the way a file server should be used.

    Ready for some network printing? Open My Computer
    and select Printers. Choose Add printer-Next-Network Printer-Next-Browse,
    select the entry for your Linux server, find the printer icon, click OK-Next, set
    it as your Windows default printer, and allow it to print a test page. If your network
    printer is ready, online, and loaded with paper, you should now see the familiar Windows
    printer test page printing out. Tell Windows that it printed OK, and that’s it!

    Adding more resources

    You will now want to add more sharable resources. For
    example, let’s make the CD-ROM drive on the Linux server sharable by everyone on the

    Simply run joe /etc/smb.conf, go to the bottom of
    the file (Ctrl-KV will get you there), and add these lines:

    comment = LAN CDROM drive (if empty, no CDROM mounted)
    path = /mnt/cdrom
    public = yes
    writable = no

    printable = no

    Now restart SAMBA server components with
    /etc/rc.d/init.d/smb restart. If you refresh your Network Neighborhood, you should
    see a share called cdrom which will show you the contents of the CD-ROM (which you
    do by inserting a CD-ROM and running the command mount /mnt/cdrom), or nothing if
    no CD-ROM is mounted.

    Congratulations, your server is up and running!

No Comments so far

Jump into a conversation

No Comments Yet!

You can be the one to start a conversation.