Windows 시스템에서 인증 및 SSL 연결 문제가 있는 CUPS 공유 프린터

Windows 시스템에서 인증 및 SSL 연결 문제가 있는 CUPS 공유 프린터

Windows 10 또는 7에서 프린터를 연결하는 데 문제가 있습니다. 기본 인증 유형이든 HTTPS이든 내 Debian에서는 모든 것이 잘 작동합니다. 나는 cup_print 사용자를 생성하고 passwd 명령을 사용하여 그에게 비밀번호를 할당했습니다. 인증 및 TLS/SSL을 비활성화하려고 시도했지만 Windows 스테이션은 CUPS가 실행되는 Raspi에 연결된 HP P1006에 연결할 수 있습니다. 유효한 사용자 요구도 시도했지만 이 옵션을 사용하면 사용자 이름: "aa" 암호: "randompassword"와 같은 모든 자격 증명을 사용하여 인쇄할 수 있습니다. 또한 Windows에서 성공하지 못한 채 SSL 연결을 수행할 때 포트 631에서 수신 대기하려고 시도했지만 Linux는 모든 옵션에서 잘 작동합니다.

Windows에서 다음과 같은 방법으로 ipp URL을 설정하려고 했습니다.
https://192.168.X.132:632/printers/HP_LaserJet_P1006
https://cups_print:[이메일 보호됨]:632/프린터/HP_LaserJet_P1006
https://[이메일 보호됨]:632/프린터/HP_LaserJet_P1006
http://[이메일 보호됨]:631/프린터/HP_LaserJet_P1006
http://192.168.X.132:631/printers/HP_LaserJet_P1006
http://cups_print:[이메일 보호됨]:631/프린터/HP_LaserJet_P1006

또한 인증이 필요하지 않은 cupd.conf를 구성하고 나중에 옵션을 켠 상태로 다시 시작한 다음 포트 편집을 통해 Windows에 자격 증명을 제공할 때 프린터를 추가하려고 했습니다. 이번에도 성공하지 못했습니다. 웹 인터페이스를 통해 모든 Windows 스테이션에서 컵 구성에 액세스할 수 있습니다. Windows에 문제가 있는 것 같습니다. 그렇지 않은 경우 해결책을 제안해 주실 수 있나요? 홈 네트워크에서 모든 것을 안전하게 보호하고 싶습니다.

내 cupd.conf 파일의 일부를 포함합니다.

# Show troubleshooting information in error_log.
LogLevel debug
PageLogFormat
MaxLogSize 0
Port 631
Listen localhost:631
Listen /run/cups/cups.sock
Listen 192.168.X.X:631
Browsing On
BrowseLocalProtocols dnssd
BrowseAllow All
DefaultAuthType Basic
WebInterface Yes
DefaultEncryption Required
SSLPort 632
SSLListen *:632
<Location />
  Order allow,deny
  Allow 192.168.X.*
  Allow 192.168.X.*
  Allow localhost
  #Allow all
  Require user cups_print
  #Require user @SYSTEM cups_print  
</Location>
<Location /printers>
  Order allow,deny
  Allow 192.168.X.*
  Allow 192.168.X.*
 Allow localhost
  #Allow all
  AuthType Basic
  Require user cups_print
  #Require user @SYSTEM cups_print  

답변1

이 문제로 일주일 동안 고생한 끝에 해결 방법을 찾았습니다.

Windows 10 1903 업데이트에서 인증을 통해 프린터를 추가하는 데 문제가 있습니다. 프린터를 추가하기 전에 먼저 포트를 설정해야 하며, 그 후에는 문제 없이 추가할 수 있습니다. 편집하고 실행할 수 있는 멋진 스크립트가 여기에 있습니다.

프린터 https 및 인증 추가 지침

스크립트 수정 레지스터 및 포트 추가

또는 레지스터를 구성하여 수동으로 추가할 수 있습니다. 두 번째 링크를 참조하세요. 포트와 프린터를 성공적으로 추가한 후(아무것도 자격 증명을 요구하지 않음) 프린터 설정, 포트 설정으로 이동하고 제공된 자격 증명으로 포트를 구성합니다. 그것들이 없으면 인쇄할 수 없습니다.

두 번째로 인증 없이 모든 위치에 대한 액세스 권한을 부여해야 합니다. 심지어 cupd.conf의 "/" 및 "/printers"도 마찬가지입니다. 그런 다음 정책 제한을 만들고 <Limit Get-Printer-Attributes>거기에서 인증이 전혀 필요하지 않습니다. 그런 다음 <Limit Cancel-Job CUPS-Authenticate-Job>및 에서 인증을 활성화합니다 <Limit Create-Job Print-Job Print-URI Validate-Job>.

자체 서명된 인증서를 사용하려는 경우 링크를 따르세요. Windows에서 자체 서명된 인증서 추가. 이 인증서를 "신뢰할 수 있는 루트 타사 인증서"에 추가하는 것을 잊지 마세요.

Windows에 IPP 프린터를 추가할 때 직면해야 하는 문제가 있는 소스가 더 있습니다. 컵 인증 문제 Windows 컵 인증 문제 Windows

내 cupd.conf(익명화)

LogLevel debug
PageLogFormat
MaxLogSize 0

SSLPort 636
SSLListen *:636

Browsing On
BrowseLocalProtocols dnssd
BrowseAllow All

DefaultAuthType Basic

WebInterface yes


DefaultEncryption required

ServerKey /etc/cups/ssl/server.key
ServerCertificate /etc/cups/ssl/server.crt

ServerAlias hostname.my_domain.net


# Restrict access to the server...
<Location />
  Order allow,deny
  Allow 192.168.X1.*
  Allow 192.168.X2.*
  Allow localhost 
</Location>

<Location /printers>
  Order allow,deny
  Allow 192.168.X1.*
  Allow 192.168.X2.*
  Allow localhost
</Location>


# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow localhost
  Deny all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Allow localhost
  Order allow,deny
</Location>

# Restrict access to log files...
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow localhost
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
    Allow all
    AuthType Basic
    Require user @SYSTEM cups_print
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @CUPS_DEFAULT_PRINTOPERATOR_AUTH@ cups_print
    AuthType Basic
    Order deny,allow
  </Limit>

  <Limit Get-Printer-Attributes>
    Order allow,deny
    Allow all
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Basic
    Require user @SYSTEM cups_print
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Basic
    Require user @OWNER @CUPS_DEFAULT_PRINTOPERATOR_AUTH@ cups_print
    Order deny,allow
  </Limit>

  <Limit Get-Printer-Attributes>
    Order allow,deny
    Allow all
   </Limit>


  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

답변2

경고

cup 2.2.1 이상의 버전에서는 cupd.conf에 사용된 ServerCertificate 및 ServerKey 지시문이 철회되었습니다.

cup-files.conf에서 CreateSelfSignedCerts 지시어가 "no"로 설정되어 있지 않으면 cup은 ${HOSTNAME}.crt 및 ${HOSTNAME}.key 이름을 사용하여 자체 서명된 인증서를 생성합니다.

인증서의 기본 경로는 cup_root + ssl 디렉토리로 유지되지만 cup-files.conf의 ServerKeyChain 지시어를 사용하여 변경할 수 있습니다.

따라서 자체 서명된 인증서 또는 정식 서명된 인증서가 있는 경우 ${HOSTNAME}.crt 및 ${HOSTNAME}.key 이름을 사용하여 SSL 디렉터리에 복사해야 합니다. 그렇지 않으면 포트 631의 https 연결이 실패하고 /var/log/cups/error.log에는 인증서 파일을 읽을 수 없다고 불평하는 수많은 줄이 포함되어 있습니다.

관련 정보