The Finger Utility


The finger utility is a more complex utility that gives the administrator a lot of information, with a syntax that allows for selective reporting. You can use finger to get information about local users or users on remote hosts on the network. RFC 1288, "The Finger User Information Protocol," is the most recent RFC in a series to define this protocol.

The finger protocol uses TCP, port 79. The finger command opens a TCP connection with a finger server daemon on a system and sends a line of text that makes up the query. The server responds and then closes the TCP connection. The RFC goes on to define different types of queries and how they can be forwarded from one machine to another. If you think that people who write these RFCs don't have a sense of humor, ponder the following paragraph taken from RFC 1288:

2.5.5. Vending Machines

"Vending machines SHOULD respond to a {C} request with a list of all items currently available for purchase and possible consumption. Vending machines SHOULD respond to a {U}{C} request with a detailed count or list of the particular product or product slot. Vending machines should NEVER NEVER NEVER eat money."

Now, with a sense of humor like that, is it any wonder that they name a user information protocol "finger"? However, you should note that as the Internet continues to infiltrate almost every type of electronic appliance, there are already "snack machines" that are part of a network. Recently, beverage machines have been developed that charge a different price depending on the current temperature! The capability to inventory such machines from a remote site can greatly reduce labor costs associated with visiting each machine on a regular basis.

The syntax for the finger command on Solaris is

finger [ -bfhilmpqsw ] [ username ... ] finger [ -l ] [ username@hostname 1 ] [@hostname 2 ...@hostname n ... ] ] finger [ -l] [ @hostname 1 [ @hostname 2 ...@hostname n ... ] ] 


where

  • -b Suppresses listing the user's home directory and the shell used when using the long format output.

  • -f Suppresses listing the header that is displayed in the non-long format output.

  • -h Suppresses printing the contents of the .project file when using the long format.

  • -i Displays "idle" format showing only the login name, terminal, login time, and idle time.

  • -l Causes a long display format. More data is shown.

  • -m Causes matches to be made on the user's username, not on the first or last name.

  • -p Suppresses displaying the contents of the .plan file when using the long format.

  • -q Produces a quick format output. This is almost the same as the short format, but the only items displayed are the login name, terminal, and login time.

  • -s Causes a short form of the user information to be displayed. Less data is shown.

  • -w Suppresses the display of the user's full name in a short format output.

The default information displayed about each user is the username, the user's full name, the terminal type, the amount of idle time, the login time, and the hostname if the user is logged in to the system remotely. If you provide a username on the command line, more information will be displayed. When using this method, you can specify more than one username and the user does not have to be logged in to the system for finger to display information about the user. However, this is limited to just users on the machine on which you are executing the finger command.

Additional information you'll see if you specify one or more usernames includes the user's home directory and login shell, the time the user logged in (or last logged in), the last time the user received any email, and the last time the user read his email. If the plain-text files .project and .plan exist in the user's home directory, their contents will be displayed.

In the syntax that uses the username@hostname1 [@hostname2 ... @hostnamen] or @hostname1 [@hostname2 ...@hostnamen], the finger request is sent first to the last hostname in the list (hostnamen), which sends it to the next-most previous host in the list, until the request reaches hostname1. Note also that the username@hostname syntax allows only the -l command-line option.

The FreeBSD syntax for this command is a little simpler. The syntax is

finger [-lmpshoT] [user ...] [user@host ...] 


where

  • -l Produces a display of several lines. All the items that the -s option outputs are displayed, along with the user's home directory, home phone number, login shell, mail status, and the contents of the files .forward, .plan, .project, and .pubkey, if these files are found in the user's home directory.

  • -m Suppresses matching of usernames. By default, finger tries to match a login username and users' real names. This option forces finger to use only the login username.

  • -p When used with -l, suppresses the listing of the contents of the .forward, .plan, .project, and .pubkey files.

  • -s Displays the user's login name, full name, terminal, idle time, login time, and either the office location and office phone number or the remote host, depending on which of the remaining options are used.

  • -h Causes the -s option to display the remote host instead of the office information.

  • -o Causes the -s option to display the office information instead of the remote host. This is the default.

  • -T Is used to disable "piggybacking" data on the initial TCP connection request with some finger implementations.

This version of finger also enables you to view information about hosts on other computers. Use the format user for users on the local machine and user@hostname for remote users.

Caution

The finger command is rarely used today. In fact, it's often disabled because it represents a security risk to have it running.





Upgrading and Repairing Networks
Upgrading and Repairing Networks (5th Edition)
ISBN: 078973530X
EAN: 2147483647
Year: 2006
Pages: 411

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net