System Administration Guide: Advanced Administration

How to Limit User Access to a Printer

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Allow or deny users access to a printer.


    # 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 5–5 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 5–5 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

The following example shows how to allow only nathan and george access to the printer luna.


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

The following example shows how to deny nathan and george access to the printer asteroid.


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