LinuxCommandLibrary

lppasswd

Manage CUPS printer user passwords

SYNOPSIS

lppasswd [ -a username ] [ -r realm ] [ -x filename ]
lppasswd -g [ -x filename ]

PARAMETERS

-a username
    Adds or updates the password for the specified username. If username is set to -, the command reads the username from standard input. If omitted, the password is set for the current user.

-g
    Enables group mode, typically used to update passwords for all administrators defined in the CUPS configuration (e.g., in /etc/cups/printers.conf). When this option is used, lppasswd prompts for a password for each relevant user or group.

-r realm
    Specifies the authentication realm for the password. The default realm is 'CUPS' if not specified. Realms help segregate different sets of credentials within the CUPS server.

-x filename
    Specifies the password file to use instead of the default. The default password file is typically /etc/cups/passwd.md5 or ~/.cups/passwd.md5 for per-user configurations.

DESCRIPTION


The lppasswd command is a utility provided by the Common Unix Printing System (CUPS) to manage user authentication for its web interface and administrative tasks. It is used to create, update, or remove encrypted passwords for users who need to access the CUPS web administration pages, typically found at https://localhost:631. Passwords managed by lppasswd are stored in a designated password file, commonly /etc/cups/passwd.md5, and are used for basic or digest authentication by the CUPS server.

It is crucial to understand that lppasswd does not manage system-level user passwords (like those in /etc/shadow) but rather a separate set of credentials specifically for CUPS's internal authentication mechanism. When executed, it prompts the user for a password, encrypts it (historically using MD5), and stores it in the specified password file, associating it with a username and an authentication realm.

CAVEATS

Passwords managed by lppasswd are historically hashed using MD5, which is considered cryptographically weak for general password storage due to its susceptibility to collision attacks and brute-force attempts given modern computational power. While acceptable for basic HTTP authentication as used by CUPS, it should not be confused with more secure system-level password hashing mechanisms (e.g., bcrypt, scrypt, Argon2). Always ensure proper file permissions on the CUPS password file (e.g., /etc/cups/passwd.md5) to prevent unauthorized access.

PASSWORD FILE LOCATION

The default password file used by lppasswd is typically /etc/cups/passwd.md5. This file contains username:encrypted_password pairs and must be readable by the CUPS daemon (cupsd) but ideally only writable by the root user (or the `lp` group if configured) to maintain security. Users can specify a different file using the -x option if necessary.

USAGE EXAMPLE

To set a password for the 'admin' user for CUPS web access:
lppasswd -a admin

You will then be prompted to enter and confirm the new password. This command will update the password in the default /etc/cups/passwd.md5 file. To remove a user's password, one typically needs to manually edit the password file or ensure the user is not defined for CUPS web access if they should no longer have it.

HISTORY

The lppasswd command is an integral part of the CUPS (Common Unix Printing System) suite, which was originally developed by Easy Software Products and later acquired by Apple Inc. Its existence dates back to the early days of CUPS, providing a dedicated tool for managing the system's internal web interface authentication separate from standard operating system user management. It has remained a stable utility within the CUPS ecosystem, evolving primarily in context with CUPS server functionality and security considerations, while its core purpose of local password management for CUPS administrators has remained consistent throughout its development.

SEE ALSO

cupsd(8), cups(1), lpadmin(8), lpstat(1)

Copied to clipboard