第 11 章 Using Samba to print to a Windows print server with Kerberos authentication


With the samba-krb5-printing wrapper, Active Directory (AD) users who are logged in to Red Hat Enterprise Linux (RHEL) can authenticate to Active Directory (AD) by using Kerberos and then print to a local CUPS print server that forwards the print job to a Windows print server.

The benefit of this configuration is that the administrator of CUPS on RHEL does not need to store a fixed user name and password in the configuration. CUPS authenticates to AD with the Kerberos ticket of the user that sends the print job.

注意

Red Hat supports only submitting print jobs to CUPS from your local system, and not to re-share a printer on a Samba print server.

Prerequisites

  • The printer that you want to add to the local CUPS instance is shared on an AD print server.
  • You joined the RHEL host as a member to the AD.
  • CUPS is installed on RHEL, and the cups service is running.
  • The PostScript Printer Description (PPD) file for the printer is stored in the /usr/share/cups/model/ directory.

Procedure

  1. Install the samba-krb5-printing, samba-client, and krb5-workstation packages:

    # dnf install samba-krb5-printing samba-client krb5-workstation
  2. Optional: Authenticate as a domain administrator and display the list of printers that are shared on the Windows print server:

    # smbclient -L <windows_print_server> -U administrator@<AD_KERBEROS_REALM> --use-kerberos=required
    
    	Sharename       Type      Comment
    	---------       ----      -------
    	...
    	Example         Printer   Example
    	...
  3. Optional: Display the list of CUPS models to identify the PPD name of your printer:

    lpinfo -m
    ...
    samsung.ppd Samsung M267x 287x Series PXL
    ...

    You require the name of the PPD file when you add the printer in the next step.

  4. Add the printer to CUPS:

    # lpadmin -p "<printer_name>" -v smb://<windows_print_server>/<printer_share_name> -m samsung.ppd -o auth-info-required=negotiate -E

    The command uses the following options:

    • -p <printer_name> sets the name of the printer in CUPS.
    • -v <URI_to_Windows_printer> sets the URI to the Windows printer. Use the following format: smb://<host_name>/<printer_share_name>.
    • -m <PPD_file> sets the PPD file the printer uses.
    • -o auth-info-required=negotiate configures CUPS to use Kerberos authentication when it forwards print jobs to the remote server.
    • -E enables the printer and CUPS accepts jobs for the printer.

Verification

  1. Log in to the RHEL host as an AD domain user.
  2. Authenticate as an AD domain user:

    # kinit <domain_user_name>@<AD_KERBEROS_REALM>
  3. Print a file to the printer you added to the local CUPS print server:

    # lp -d <printer_name> <file>
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部