Operating System - HP-UX
1834156 Members
2829 Online
110064 Solutions
New Discussion

restrict access to a printer

 
Darrell Allen
Honored Contributor

restrict access to a printer

I don't believe this can be done in HPUX but I hope someone can prove me wrong.

Can access to a printer be restricted to specific users?

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: restrict access to a printer

Hi Darrell:

Some versions of UNIX have an lpadmin -p printer -u allow:user1,user2 (or -u deny:user1,user) option that does just what you want but HP-UX is not among them. However, it should be possible via a little scripting to rename /usr/bin/lp to /usr/bin/lp2 and have /usr/bin/lp do the user list lookups and then call /usr/bin/lp2.

Regards, Clay

If it ain't broke, I can fix that.
Roger Baptiste
Honored Contributor

Re: restrict access to a printer

hi,

There is no such provision
for the native LP commands
in HP-ux. You can write
a wrapper for the lp command
which will check for users
before proceeding to execute
the lp command

-raj
Take it easy.
S.K. Chan
Honored Contributor

Re: restrict access to a printer

..or you can modify /var/spool/lp/sinterface/ script ... to control user access to .

my 2cents
Darrell Allen
Honored Contributor

Re: restrict access to a printer

Hi everyone,

Thanks for the replies. S.K., I believe that should be /var/spool/lp/interface directory.

All good ideas that can work. The basic problem is that users don't always choose the printer they should. Wish I could upgrade them so that they would.

After thinking about it further, there's a problem with the whole printer restriction issue: processing is performed to prepare print data before it is sent to lp. For example, our application (Mfg/Pro) has printer queues defined which in turn call lp. Long running reports would generate a print file that would be sent to a printer that wouldn't allow it to print. Even if I identify the spooled print file, I have no way of knowing what printer the user really should be using. Scripting to prompt for another printer choice would be a maintenance issue that I don't believe is worth the effort. I might could notify the user that his output could not be printed but he'd have to re-run the report.

In this case, I really need for the application to do pre-processing verification of the user's access to the printer specified. Oh well.

Thanks,

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)