LinuxCommandLibrary

cupsctl

Control the CUPS printing system

TLDR

Display the current configuration values

$ cupsctl
copy

Display the configuration values of a specific server
$ cupsctl -h [server[:port]]
copy

Enable encryption on the connection to the scheduler
$ cupsctl -E
copy

Enable or disable debug logging to the error_log file
$ cupsctl [--debug-logging|--no-debug-logging]
copy

Enable or disable remote administration
$ cupsctl [--remote-admin|--no-remote-admin]
copy

Parse the current debug logging state
$ cupsctl | grep '^_debug_logging' | awk -F= '{print $2}'
copy

SYNOPSIS

cupsctl [--help] [--[no-]debug-logging] [--[no-]remote-admin] [--[no-]remote-any] [--[no-]share-jobs] [--[no-]share-printers] [--[no-]user-cancel-any] [name=value ...]

PARAMETERS

--help
    Display command usage and options.

--debug-logging
    Enable debug logging in CUPS (LogLevel debug); overrides existing setting.

--no-debug-logging
    Disable debug logging in CUPS (LogLevel info).

--remote-admin
    Allow remote administrative access (RemoteAdmin on).

--no-remote-admin
    Disable remote administration (RemoteAdmin off).

--remote-any
    Allow any host to access server (RemoteAny on).

--no-remote-any
    Restrict access to localhost (RemoteAny off).

--share-jobs
    Share print jobs with other users (ShareJobs on).

--no-share-jobs
    Do not share print jobs (ShareJobs off).

--share-printers
    Share local printers (SharePrinters on).

--no-share-printers
    Do not share printers (SharePrinters off).

--user-cancel-any
    Allow users to cancel any job (UserCancelAny on).

--no-user-cancel-any
    Restrict job cancellation to owner (UserCancelAny off).

[name=value ...]
    Set arbitrary cupsd.conf directives (e.g., ServerName myhost).

DESCRIPTION

cupsctl is a command-line utility for configuring the CUPS (Common UNIX Printing System) print server. It modifies settings in the cupsd.conf configuration file, typically located at /etc/cups/cupsd.conf, and automatically reloads the CUPS daemon (cupsd) to apply changes without requiring a full restart. This tool is essential for administrators managing print queues, sharing, security, and logging on Linux and Unix-like systems.

Common uses include enabling printer sharing across networks, toggling remote administration, controlling job sharing visibility, and enabling debug logging for troubleshooting. Options are provided as toggles (e.g., --share-printers or --no-share-printers) or direct attribute assignments (e.g., SharePrinters yes). Running as root is required, as it directly edits system files and signals the daemon.

While powerful, it focuses on server-side directives from cupsd.conf, not client or printer-specific configs handled by tools like lpadmin. It's widely used in enterprise environments for secure print server setup.

CAVEATS

Requires root privileges (use sudo). Only modifies select directives; use cupsd.conf directly for advanced configs. Automatically sends SIGHUP to cupsd, but may fail if daemon is stopped.

EXAMPLES

cupsctl --share-printers --no-remote-admin
cupsctl ShareJobs yes WebInterface yes
Enable sharing and web UI.

FILES

Edits /etc/cups/cupsd.conf; logs to /var/log/cups/error_log.

HISTORY

Developed by Michael Sweet as part of CUPS 1.0 (2001) by Easy Software Products. Integrated into most Linux distros post-2002. Maintained by OpenPrinting project after Apple acquired CUPS in 2007; current in CUPS 2.x/3.x.

SEE ALSO

cupsd(8), lpadmin(8), cups.conf(5), systemctl(1)

Copied to clipboard