System Administration Guide

How to Limit User Access to a Printer

  1. Log in as superuser or lp on the print server.

  2. Allow or deny users access to a printer by using the lpadmin command.


    # lpadmin -p printer-name -u allow:user-list [ deny:user-list]
    -p printer-name
    

    Name of the printer to which the allow or deny user access list applies. 

    -u allow:user-list
    

    User names to be added to the allow user access list. You can specify multiple user names with this command. Use a space or a comma to separate names. If you use spaces, enclose the list of names in quotes. 

    Table 42-4 provides the valid values for user-list.

    -u deny:user-list
    

    User names to be added to the deny user access list. You can specify multiple user names with this command. Use a space or a comma to separate names. If you use spaces, enclose the list of names in quotes. 

    Table 42-4 provides the valid values for user-list.

    The specified users are added to the allow or deny user access list for the printer in one of the following files on the print server:

    /etc/lp/printers/printer-name/users.allow

    /etc/lp/printers/printer-name/users.deny


    Note -

    If you specify none as the value for user-list in the allow user access list, the following files are not created for the print server:

    /etc/lp/printers/printer-name/alert.sh

    /etc/lp/printers/printer-name/alert.var

    /etc/lp/printers/printer-name/users.allow

    /etc/lp/printers/printer-name/users.deny


  3. Check the information following the Users allowed or Users denied heading in the output of the following command.


    $ lpstat -p printer-name -l
    

Examples--Limiting User Access to a Printer

In the following example, the command allows only the users nathan and george access to the printer luna.


# lpadmin -p luna -u allow:nathan,george

In the next example, the command denies the users nathan and george access to the printer asteroid.


# lpadmin -p asteroid -u deny:"nathan george"