Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Allow and deny printing by specific SSH users System
If, like myself, you have users on your system that only log in remotely over SSH, you'll find that by default Mac OS X lets all users print to a CUPS supported printer from the command line using the lpr command. If you would like to restrict command line acces to your printer(s), you can do so using the lpadmin command. Full instructions on how to do this can be found in your local CUPS documentation.

CUPS supports "allow" and "deny" lists, so that you can specify a list of users who are allowed to print or not allowed to print. The following command allows peter, paul, and mary to print to the named printer, but all other users cannot print.
 % /usr/sbin/lpadmin -p printer -u allow:peter,paul,mary
The following command has the opposite effect -- all users except peter, paul, and mary will be able to print to the named printer.
 % /usr/sbin/lpadmin -p printer -u deny:peter,paul,mary
When specifying a user, use their short username. To find out the CUPS name of your printer, try:
 % lpstat -s
NOTE: The allow and deny options are not cummulative. That is, you must provide the complete list of users to allow or deny each time. Also, CUPS only maintains one list of users - the list can allow or deny users from printing. If you specify an allow list and then specify a deny list, the deny list will replace the allow list - only one list is active at any time.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[4,900 views]  

Allow and deny printing by specific SSH users | 0 comments | Create New Account
Click here to return to the 'Allow and deny printing by specific SSH users' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.