From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079040315801.tru64-unix-managers.marc@archive.invalid> From: Phetphone_Chanthavong () bedison ! com Date: Tue, 20 Apr 1999 16:53:02 +0000 To: tru64-unix-managers Subject: SUMMARY: restrict access to the UNIX printer-queue X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079040315801 Original question: Hello every one, Is there a way to restrict the public access to print any files to the unix printer-queue, but only allow only a particular group of people to print to it. Thanks, -PC -------------------------------------------------------------------------------- Responded: Jiri Landkammer: --------------- I have a solution for remote printer. You must created /etc/hosts.lpd file where first field on line is server and second is user name which can use the printer. The second field need not entered (maybe). ------------------------------------------------------------------- Stephan Branchoux: ------------------ you can define a rectricted_group in /etc/group and use it in /etc/printcap: For example in printcap file : 15|lp0|hpsiup:\ :rg=restricted_siup:\ :lf=/usr/adm/lperr15:\ :lp=:\ :rm=hpsiup:\ :rp=texte:\ :sd=/usr/spool/lpd15:\ :sh: # and in /etc/group file : # grep restrict /etc/group restricted_siup:*:5000:root,user1,user2 # ------------------------------------------------------- Cy Landkammer: -------------- asiest way is to chgrp the lpr command. There is already in an lpr group in my /etc/group file, access would be restricted according to the permissions on a group basis. Alternatives are: Create a wrapper for the lpr command that checks the users group memberships, or use an acl list under C2 to control access to the lpr command. To create a wrapper make a script to do the checking and call lpr from it. Move lpr to another location or put the script in the users path first. Using setuid on the script and changing the ownership of lpr can restrict access to lpr even further. In ksh something like this would do as a wrapper: for USERGROUP in `groups $LOGNAME`; do case $USERGROUP in print) : /bin/lpr $1 $2 $3 $4 $5 $6 ;; done --------------------------------------------------------------------- Well, I only choose the method from Stephan and it works great. By, the way :rg is not supported docs feature by Compaq, but maybe other system V UNIX. Thanks, -PC