host.lpd or hosts.equiv

How do I set up my host.lpd or host.equiv file ?  Can you give me am example ?  Do you need them for network printing ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I'm guessing you're asking about hosts.lpd hosts.equiv (note, contrary to your questions, hosts is plural) because they are mentioned in the man page for lpd.

      man lpd

Linux really should provide a manpage for the files themselves, but many distributions do not provide them.

This file contains a list of hosts that are permitted to print to queues on this server.

When lpd receives a print request it checks this file to see if the request is coming from an authorized machine.

The format of the file is just a list of hostnames:

The hosts.equiv file is used by what are known as the "r-tools":  in.rexecd, in.rlogind, in.rshd.  These programs allow users from other machines to log into (or run commands on) your server (normally without a password) by running rexec, rlogin, rsh.  The hosts.equiv file lists the hosts trusted by your server.

The format of this file is also a list of machines, however you can optionally add a username to trust that user on the remote machine to pretend to be someone else (like root!!).  You can also add a '-' before hosts and usernames to disallow those hosts or users.  You can also specify a '+' character instead of host name to signify _any_ host.

Running servers for "r-commands" can be dangerous and is in my opinion a Bad Idea.  In particular, using a hosts.equiv file allows just about anyone on some other machine to do just about anything to your machine.  I will not give an example of a hosts.equiv file.  I've described its makeup.  It in NOT necessary for network printing.  If you have a further interest in r-commands read the man pages for rshd and hosts.equiv.
      man rshd
      man hosts.equiv

I hope the above has answered your question.  A few more comments about network printing:

Detailed documentation can be found in the Printing-HOWTO:

You can set up print queues by editing the printcap file
      man printcap

or by using printtool (RedHat)

The queues on the print server must point at the printer.  The queues on the client machine must point at the server (options 'rm' and 'rp' in the printcap file)

(as an additional note, you can require that the remote machine claim to be sending the print reuqest on behalf of a user with an account on the print server, by specifying the 'rs' option for the queue in the printcap file.)

You need the following to make network printing work:

on the server:

lpd installed

/etc/printcap configured

spool directories for each queue as specified in             
/etc/printcap (usually /var/spool/lpd/...)

/etc/hosts.lpd configured

lpd running

on the client:

/etc/lpd installed

/etc/printcap configured to point to remote print server

spool directories for queues queues

lpd running.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
reminAuthor Commented:
I tried looking through at least 20 books and could not find the information given above regarding hosts.equiv and hosts.lpd .  
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.