Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Linux #3 "You teach best...."

You are here: irt.org | Articles | Linux & Apache | Linux #3 "You teach best...."

Published on: Saturday 17th October 1998 By: Tarique Sani

Introduction

"You teach best, what you need to learn the most!" - Richard Bach, whose book Jonathan Livingstone Seagull inspired me to dream and be different. I quote this here because though this article is about setting up a Linux file, print and security server, my experience of setting up a network consists of just 2 installations with only 7 and 3 clients respectively. So I need lots of inputs from the Linux Gurus out there but to newbie Sys Admins I would like to say that the process is simple and best of all works on mortal hardware.

Need to Know and Assumptions

At this point I will assume that you have successfully installed Red Hat Linux on to your machine which will be the server and also that you have installed your printer as well, if not then do so now with the printer configuration tool on the Control Panel (you have to start X windows first though). Most of the defaults are to be left as they are.

Configuring the Server.

The Windows-style networking is actually the SMB (Server Message Block) protocol based networking and there is nothing MS proprietary about it. Under Linux we will be using SAMBA which is Andrew Tridgell's original implementation for SMB protocol under Unix. Please don't be put off by all the technical details for configuration you just have to edit one file /etc/smb.conf a few lines added and modified will have your server ready. Fire up your favorite text editor joe, jed or Xjed, open the smb.conf file (the smb.conf file is a plain text file). You will see lots of things and comments some of them may be familiar if you have worked on networks before (so I am told) do the following

  • 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 SANIsoft, we changed it to SANISOFT, 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.

  • Go down further till you find the item security =, make sure it is security = user

  • 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. Same for preferred master =. Make sure that no semicolon (;) is given before any of these entries or the entry will be disabled.

  • Locate domain logons = and set it to yes.

  • Still further 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 /home/netlogon (we will need this value later).

  • Finally, scroll down till you find a commented-section ;[tmp] and remove the semicolons from that section too.

  • Whew! done - save the file and exit the text editor.

More can be done here, but let's first get these running. 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. Finally, enter the command /etc/rc.d/init.d/smb restart to tell the SAMBA server components to restart using this new configuration file. That it! Your Linux-based file, print, and security server is actually ready for action!

Configuring Windows Clients

Just to drive home the point that Linux is simpler I would like to warn that this section to follow is much longer than the preceding one. A funny thing - 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! (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 SANISOFT-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 (Dynamic Host Configuration Protocol) to obtain such information, and since we have configured a DHCP server, 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 SANISOFT).You can also enter a short description for your computer.

  • Whew again! 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, 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 Neighbourhood icon. If you are prompted for the Windows logon password just delete it and you won't be bothered in future

Once you are successfully logged in, you should be able to see your Linux server's name through the Network Neighbourhood 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 edit /etc/smb.conf, go to the bottom of the file, and add these lines:

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

Now restart SAMBA server components, If you refresh your Network Neighbourhood, 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.

Last word

That's it for now, Yes I know that I have left out the bit on DHCP and DNS set up but that's in the next article. meanwhile read the Network Administrators Guide which come with Linux for more information.

View the profile on Tarique Sani and the list of other Articles by Tarique Sani.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.