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
NOSs.
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.
width="400" height="239">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
(startx)
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):
- Fire up the printer configuration tool from the Control
Panel.- 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".- 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).- 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
Printer, 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
text, though this option plays a role only with text that originates from a Unix
machine.- 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!- 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
understand.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
configured:
- 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
clients.- 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.- 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
disabled.- Now comes the important thing–find the item domain
logons = and set it to yes.- Almost there, scroll down till you find a commented-section ;
.
Remove the semicolons from the beginning of each line in that section. Note that the path
is shown as
/home/netlogon (we will need this value later).- Finally, scroll down till you find a commented-section ;
and remove the semicolons from that section too.- 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
/home/netlogon 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.)
- In Win 95, select Start-Settings-Control Panel-Network.
- If you do not have Client for Microsoft Networks
installed, click on Add-Client, Add-Microsoft, Client for Microsoft
Networks, and click OK.- Select Client for Microsoft Networks, and click on Properties.
- 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.- On the same screen make sure you enable Quick logon.
Then click on OK.- Now make sure you have TCP/IP installed. If you don’t
have, click on Add-Protocol-Add-Microsoft-TCP/IP-OK.- 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.
- 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.- Select WINS and make sure that Use DHCP for WINS
resolution is checked.- 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
process.- Select DNS configuration and disable DNS (don’t
worry, DHCP will supply you with the needed values).- Select Bindings and ensure that Client for
Microsoft Networks is enabled.- Select Advanced and make sure that this protocol is
set as the default protocol, then click on OK.- At the Network configuration screen, make sure Primary
Network Logon is set to Client for Microsoft Networks.- 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
network.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 = noNow 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!