Copyright ©1996, Que Corporation. All rights reserved. No part of this book may be used or reproduced in any form or by any means, or stored in a database or retrieval system without prior written permission of the publisher except in the case of brief quotations embodied in critical articles and reviews. Making copies of any part of this book for any purpose other than your own personal use is a violation of United States copyright laws. For information, address Que Corporation, 201 West 103rd Street, Indianapolis, IN 46290 or at support@mcp .com.
If you want people to be able to get particular types of information about your users such as when they were last online, when they last checked mail (which information is offered is configurable), you will want to install a Finger server. Instead of installing the default Finger server, you are going to install a more configurable one that will give you and your users more control of the information going out to the world.
Offering Finger is a simple way to let people set up something to tell the world a little bit about themselves. In a way, Finger offers the chance to make a simple text personal Web page! Also, outside users can use Finger to find out someone's e-mail address.
In this chapter, you learn how to:
Once again, this is a server that you have to compile. However, code just doesn't get much simpler than a Finger server, so this compilation should be pretty headache-free. Just take your time and make sure not to make any typos during what little file editing you may do.
The Finger server you're going to use is Kfingerd-0.04. This is a daemon, which runs in the background and waits for Finger requests to come in.
To locate and decompress Kfingerd, perform the following procedure:
Now, there is a little file editing you need to do before compiling your Finger server. In fact, you don't need to edit anything if you don't plan to create dummy accounts (fake accounts created just so people can Finger them and get information from your site, for example info).
If you don't plan to create dummy accounts, skip to the next section. If you're not sure, then go ahead and follow along and make the few necessary changes.
To make the changes you want, do the following:
Once again, the comment lines in this program begin with /* and end with */.
Finger is a simple program, so takes little time to compile and requires only a bit of file shuffling and security consideration to install.
To compile Kfingerd, do the following:
There are a number of fairly small and simple steps involved in installing your Finger server.
First, create a home directory for Finger itself. This is where you will put your dummy accounts later. To create this directory, do the following:
Move the compiled file, Kfingerd, to somewhere like /usr/sbin, where most daemons and other items that only root should be running go.
To run Kfingerd at startup with the other inetd items, do the following:
finger stream tcp nowait root /usr/sbin/tcp /usr/sbin/kfingerd
You will find this line already in your inetd.conf file, but the user is incorrect. All you need to do is change the user daemon to root in this line.
You can either reboot your system to get Kfingerd running, or type kill -HUP # where # is inetd's process ID number, and then type /etc/inetd to get it running again.
One reason I chose Kfingerd instead of the standard, normal, everyday Finger is because it is a more configurable program. The standard Finger hands out a list of information that not everyone wants people to have access to. Kfingerd allows each user to choose what information is available to outsiders fingering their accounts, and what information is not available.
The file used to individually configure Finger output is called .fingerrc.
There are a number of commands available to users who want to configure their Finger output (see table 11.1).Table 11.1 Commands Available in a .fingerrc File
Command Function [no]mail [doesn't] provide information on new mail, or if all mail has been read [no]remote [doesn't] provide information on where people are logged in from if it's an outside site [no]ttys [doesn't] provide information on what tty someone is logged in from [no]idle [doesn't] provide information on how long someone has been idle [no]log [doesn't] log the Finger request in ~/.fingerlog [no]plan [don't] show the user's plan file [no]proj [don't] show the user's project file [no]auth [don't] use ident to get a username for the person making the Finger request projfnm Define the name of the project file planfnm Define the name of the plan file progfnm Define a program Finger should call subdfnm Define a subdirectory where plan files are kept
Items in brackets ([]) are optional.
For the last four items (those that define files to call or use), if you don't include the name of the file, the item is disabled. For example, if you just enter projfnm without a file name, project files are disabled.
You can also add the parameters in table 11.2 in front of any of the commands listed in table 11.1.Table 11.2 Additional Command Parameters for the .fingerrc Commands
Parameter Function IP[!] [Don't] execute the command following this parameter unless it comes from the IP address listed HN[!] [Don't] execute the command following this parameter unless it comes from the host name listed HNR Remap host names somewhere else
Now, to get a feel for how all of these commands work together, create a sample .fingerrc file. Let's say that I would like to have the following information available and not available:
My .fingerrc file would contain the following:
#Enable mail information mail #Don't show login locations, whether tty or remote machine noremote nottys #Don't show idle time noidle #Remap my local host names to one local host name HNR davinci.renaissoft.com local HNR catherine.renaissoft.com local HNR magellan.renaissoft.com local HNR vivaldi.renaissoft.com local #Log Finger requests except from my own site !HN= local log #Show plan file and assign location to ~/.plan plan planfnm ~/.plan
You may want to create a default .fingerrc file to put in all user home directories, with comments, so your users can modify them to fit their preferences.
Now, test Finger to make sure that you've installed it properly! Fortunately, verifying Finger is pretty quick and easy. There are four procedures you should test:
Kfingerd only effects remote Fingers (Fingers from an outside host). It doesn't affect local Fingers, meaning that if you just type finger dee, for example, you will get the default Finger response instead of the custom response I set up for myself. This difference in response is caused by the fact that if you don't include the name of the host, the Finger client doesn't bother asking the server about the settings that would point it to the /home/dee/.fingerrc file.
If you want to change this, you will need to locate the source for your Finger client and edit it to ensure that it always checks with the Finger server instead of assuming that check is not necessary with local Fingers.
You can find an up to date version of the Finger client source by FTPing to sunsite.unc.edu, going to the directory /pub/Linux/system/Network/finger, and getting the file finger.atbug.tgz.
Make up a userid that doesn't exist on your system, and Finger it at one of the host computers (for example, in my case, finger blort@davinci would be a good test, see fig. 11.1).
Fig. 11.1 Fingering an account that doesn't exist on my site, and getting the response I set in my badfinger.c instead of a list of accounts on my site.
Confirm that what you included in your badfinger.c file works properly by fingering an account that you know doesn't exist on your site, and making sure it gives the output you wanted. If not, you may need to change badfinger.c and recompile Kfingerd.
Finger an account you know exists (your own will certainly do, an example for me would be dee@catharine, or just dee since I'm not fingering from outside). Take note of what kind of information shows in the Finger response (see fig. 11.2).
Fig. 11.2 Fingering my account and seeing that it works.
Write up a simple .fingerrc file and place it in, say, your home account. Then, Finger your account@host (e.g., dee@catharine) and see if it looks different from the default. If not, make sure you didn't comment out any important lines (using # at the beginning of the line), or that you didn't mistype .fingerrc.
First, before you can Finger a dummy account, you have to create one. Create a quick dummy account by doing the following:
For an example, I fingered info on my site (see fig. 11.3).
The output from the dummy account info on my site, containing contact and server information.
For technical support for our books and software contact support@mcp.com
Copyright ©1996, Que Corporation