[gelöst] cups Netzwerkfreigabe GUI mit ssh Verbindung

Einrichten des lokalen Netzes, Verbindung zu anderen Computern und Diensten.
Antworten
AxelMD
Beiträge: 1453
Registriert: 15.03.2009 08:02:11

[gelöst] cups Netzwerkfreigabe GUI mit ssh Verbindung

Beitrag von AxelMD » 20.12.2020 21:09:03

Hallo Forum,

wie gebe ich http://192.168.178.44:631/ auf einem Server frei?
Ich habe nur einen ssh Zugriff auf den Server.

Code: Alles auswählen

systemctl status cups.service
● cups.service - CUPS Scheduler
   Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-12-20 20:54:58 CET; 13min ago
     Docs: man:cupsd(8)
 Main PID: 774 (cupsd)
    Tasks: 1 (limit: 4673)
   Memory: 1.7M
   CGroup: /system.slice/cups.service
           └─774 /usr/sbin/cupsd -l

Dec 20 20:54:58 p5 systemd[1]: Started CUPS Scheduler.

Code: Alles auswählen

 groups
users cdrom floppy audio dip video plugdev netdev ssh lpadmin scanner axel
Es ist noch kein Drucker eingerichtet.
Der Druck funktioniert mit anderem Debian 10 Buster System, hier ist LXQt installiert.
Dadurch war http://localhost:631 erreichbar und die Freigabe für die Netzwerkadministration konnte eingestellt werden.

Fehlermeldung im Browser:
Die Website ist nicht erreichbar192.168.178.44 hat die Verbindung abgelehnt.
MfG

AxeMD
Zuletzt geändert von AxelMD am 20.12.2020 22:11:27, insgesamt 1-mal geändert.

Benutzeravatar
jph
Beiträge: 1090
Registriert: 06.12.2015 15:06:07
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Münsterland

Re: cups Netzwerkfreigabe GUI mit ssh Verbindung

Beitrag von jph » 20.12.2020 21:29:22

Auf dem CUPS-Server die GUI aufrufen -> Verwaltung -> Fernwartung zulassen. Oder, falls du nur ssh hast: # cupsctl --remote-admin, siehe man 8 cupsctl

AxelMD
Beiträge: 1453
Registriert: 15.03.2009 08:02:11

Re: cups Netzwerkfreigabe GUI mit ssh Verbindung

Beitrag von AxelMD » 20.12.2020 21:36:12

nano /etc/cups/cupsd.conf

Code: Alles auswählen

#
# Configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn
PageLogFormat

# Deactivate CUPS' internal logrotating, as we provide a better one, especially
# LogLevel debug2 gets usable now
MaxLogSize 0

# Only listen for connections from the local machine.
Listen localhost:631
Listen /run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols dnssd

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

# Restrict access to the server...
<Location />
  Order allow,deny
</Location>

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

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

# Restrict access to log files...
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</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
  </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 @SYSTEM
    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 @SYSTEM
    Order deny,allow
  </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 Default
    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 @SYSTEM
    Order deny,allow
  </Limit>

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

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

# Set the kerberized printer/job policies...
<Policy kerberos>
  # 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 Negotiate
    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 Negotiate
    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 @SYSTEM
    Order deny,allow
  </Limit>

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

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
Zuletzt geändert von AxelMD am 20.12.2020 22:00:14, insgesamt 2-mal geändert.

AxelMD
Beiträge: 1453
Registriert: 15.03.2009 08:02:11

Re: cups Netzwerkfreigabe GUI mit ssh Verbindung

Beitrag von AxelMD » 20.12.2020 21:46:07

Oder, falls du nur ssh hast: # cupsctl --remote-admin, siehe man 8 cupsctl

Code: Alles auswählen

cupsctl(8)                                       Apple Inc.                                       cupsctl(8)

NAME
       cupsctl - configure cupsd.conf options

SYNOPSIS
       cupsctl  [ -E ] [ -U username ] [ -h server[:port] ] [ --[no-]debug-logging ] [ --[no-]remote-admin ]
       [ --[no-]remote-any ] [ --[no-]share-printers ] [ --[no-]user-cancel-any ] [ name=value ]

DESCRIPTION
       cupsctl updates or queries the cupsd.conf file for a server. When no changes are requested, the  cur‐
       rent  configuration  values  are  written  to the standard output in the format "name=value", one per
       line.

OPTIONS
       The following options are recognized:

       -E   Enables encryption on the connection to the scheduler.

       -U username
            Specifies an alternate username to use when authenticating with the scheduler.

       -h server[:port]
            Specifies the server address.

       --[no-]debug-logging
            Enables (disables) debug logging to the error_log file.

       --[no-]remote-admin
            Enables (disables) remote administration.

       --[no-]remote-any
            Enables (disables) printing from any address, e.g., the Internet.
 Manual page cupsctl(8) line 1/68 62% (press h for help or q to quit)
Damit kann ich nicht so recht was anfangen.


Wie geht das genau mit ssh?

https://www.cups.org/doc/sharing.html

Code: Alles auswählen

cupsctl --share-printers --remote-any
Dann im Browser:

http://192.168.178.44:631/

AxelMD
Beiträge: 1453
Registriert: 15.03.2009 08:02:11

Re: [gelöst] cups Netzwerkfreigabe GUI mit ssh Verbindung

Beitrag von AxelMD » 20.12.2020 22:13:09

Kurzantwort von AxelHD an AxelHD:

Hallo AxelHD, Du bist verbund per ssh und gibst als root ein:

Code: Alles auswählen

cupsctl --share-printers --remote-any
Wenn Du weiteres wissen möchtest kann Du da schauen:

https://www.cups.org/doc/sharing.html

MfG
AxelHD an AxelHD

Antworten