How to Install cfingerd and Install Shell Scripts

cfingerd is a version of fingerd which allows on the fly configuration without having to reboot your machine. Click here to download it. Just gunzip and untar the file cfingerd-1.1.1B2.tar and run the Configure script.

In order to use cfingerd, you need to modify /etc/cfingerd.conf. In this file, you need to create your fakeusers, such as "temp@burrow.mit.edu", and point cfingerd to a script you want to run when the fakeuser is fingered at your machine. An example of such a line is

  FAKEUSER=temp,Local Temperature,TRUE,/etc/cfingerd/scripts/temp 
where the script is in /etc/cfingerd/scripts. You might also want to alter your banners, contained in /etc/cfingerd.

A shell script can be thought of as a batch file, or a series of commands you'd like your computer to execute all at once upon referencing a single command. In order to create a shell script, this is all you need to do: make a new file in your favorite editor with the following line as the first line:

#!/bin/sh
This tells your computer to use /bin/sh, the standard shell, to execute the commands contained in the shell script. After this line, you can put any valid UNIX command and the computer will execute it. Note that it is always a good idea to include absolute pathnames when referring to commands, e.g., instead of just specifying printtemp, specify /usr/local/bin/printtemp.

An example of a shell script is as follows:

#!/bin/sh
echo " -----------------------------------------------------------------------
------"
/usr/local/bin/printtemp
echo "Temperature measurements accurate to +/-3 degrees"
echo "For a graph of the temperature over the past 3 days finger graph@burrow"
echo " -----------------------------------------------------------------------
------"
You can alter the #!/bin/sh line to point to your favorite shell, such as /bin/tcsh.

In order to make the script runnable, you need to change the file's mode. Suppose the above script were saved in the file temp. At the command line, just type

chmod a+x temp
and that will make temp executeble. If you ls -l the file, you should get something that looks like the following:
-rwxr-xr-x   1 root     root          343 Sep 30 01:31 temp
The "x"'s in the first field indicate that the file is executeable. Normal files just have "-" instead of "x".

Always make sure that you've installed the script in the correct directory with the correct permissions. Some computers require that the program accessing the serial port be run as root. In order to change the owner of the file, just type

chown root filename
when you are superuser.


Andrew Huang <bunnie@mit.edu>
Ara Knaian <ara@mit.edu>