cupsaddsmb
Share CUPS printers with Windows clients
SYNOPSIS
cupsaddsmb [ -H server ] [ -U username ] [ -v ] -a
cupsaddsmb [ -H server ] [ -U username ] [ -v ] printer ...
PARAMETERS
-H server
Specifies the CUPS server hostname or IP address to connect to. If not specified, the default is the local host.
-U username
Specifies the username to use for authentication with the CUPS server. If not specified, the command may prompt for credentials.
-v
Enables verbose output, providing more detailed information about the operation and any errors encountered during the process.
-a
Exports all currently configured CUPS printers to the Samba server. This option is mutually exclusive with specifying individual printer names.
printer ...
Specifies one or more specific CUPS printer names to export to Samba. Multiple printer names should be separated by spaces. This option is mutually exclusive with the -a option.
DESCRIPTION
cupsaddsmb is a command-line utility provided by the Common Unix Printing System (CUPS) that automates the process of exporting CUPS-configured printers to a Samba server. This allows Windows clients on the network to easily discover, connect to, and print through these shared printers.
It typically configures the Samba [printers] share and manages the necessary printer definitions and settings within Samba's internal database (like printers.tdb). The command simplifies the integration of CUPS-managed print services into a Microsoft Windows network environment, enabling seamless access for Windows users without extensive manual Samba configuration for each printer. It requires appropriate permissions to interact with both the CUPS daemon and the Samba server, often necessitating root or administrative privileges.
CAVEATS
Permissions: Running cupsaddsmb typically requires root privileges or a user with sufficient permissions to modify CUPS configuration and Samba's printer database.
Samba Configuration: The Samba [printers] share must be correctly configured in smb.conf (e.g., with browsable = yes, printable = yes, and an appropriate path).
Samba RPC Client: The command often relies on the rpcclient utility (part of the Samba package) to interact with the Samba server's RPC interface. Ensure rpcclient is installed and accessible in the system's PATH.
Driver Management: While cupsaddsmb configures printers in Samba, the actual Windows printer drivers might still need to be manually uploaded to the Samba server's driver store (e.g., [print$] share) for automatic client installation.
Security: Care should be taken regarding the security implications of exposing printers via Samba, especially concerning guest access and driver installation policies.
DRIVER STORE FOR WINDOWS CLIENTS
For Windows clients to automatically download printer drivers when connecting to a shared printer, the Samba server usually needs a designated 'driver store' (often shared as [print$]). While cupsaddsmb handles the printer definition, the actual driver files may need to be uploaded to this store separately using other Samba tools or manual methods.
AUTHENTICATION TO CUPS
When cupsaddsmb connects to the CUPS server, if the -U username option is not provided, it may attempt to authenticate as the current user or prompt for a username and password, depending on the CUPS server's authentication settings (e.g., AuthType Basic, AuthType Digest).
TESTING AND VERIFICATION
After running cupsaddsmb, it is highly recommended to test the printer sharing from a Windows client. Verify that the printer is discoverable in the network, drivers can be installed, and print jobs are successfully processed.
HISTORY
cupsaddsmb was developed as an integral part of the CUPS project, specifically to address the need for seamless interoperability between Unix-based printing environments and Microsoft Windows networks. Its introduction significantly simplified the previously complex and manual task of configuring shared printers within Samba for Windows clients. This command has been crucial in establishing CUPS as a robust and widely adopted printing solution in mixed OS environments, facilitating the sharing of printers without deep manual intervention in Samba's configuration files for each printer.