Gentoo Archives: gentoo-user

From: Dan Egli <dan@×××××××××××.site>
To: gentoo-user@l.g.o, Michael <confabulate@××××××××.com>
Subject: Re: [gentoo-user] Sharing printers via Cups
Date: Tue, 09 Feb 2021 19:23:58
Message-Id: 06c4e7f7-818e-8078-ae70-ab27c90d3c11@newideatest.site
In Reply to: Re: [gentoo-user] Sharing printers via Cups by Michael
1 On 2/9/2021 3:20 AM, Michael wrote:
2 >
3 >> Actually tried that. Got LPD installed, sent a test page. Test page
4 >> appeared in the Windows Queue, then disappeared without any
5 >> acknowledgement from the printer.
6 > This would need some troubleshooting/configuring on the Windows end. It's a
7 > long time ago I tried this and don't recall what I had configured to allow
8 > clients to print via the Windows PC. It was relatively simple and lightweight
9 > though, unlike Samba which I wouldn't bother with just for printing.
10 If it was JUST for printing I'd agree. But the whole samba setup is for
11 more than that. There's also file sharing (since Windows 10 home doesn't
12 support NFS), central authentication, things like that.
13 >
14 >> I finally got it working in samba mode
15 >> so I'm good with that. And that, again, would skip the whole point of
16 >> having a central print server. :)
17 > Not really. Athena would remain the CUPS server for itself and any Linux or
18 > additional OS clients, sending jobs over IPP:// to the Windows print server
19 > running on the Windows PC.
20 >
21 Okay, I could see that one. Although I'm totally lost when it comes to
22 IPP. I've looked but apparently my google-fu is still weak because I
23 can't find any good documentation on how to setup IPP, how to format the
24 URLs, etc....
25 >>> 3. If the current setup is the right thing for you, increase CUPS log
26 >>> verbosity and check the logs on Athena to find out what it isn't happy
27 >>> with
28 >>> when Janus sends a print job to it. First check the CUPS driver and
29 >>> printing protocol is the same on Janus as on Athena and the CUPS' config
30 >>> on Athena allows inbound connections from your LAN, or your Janus' IP
31 >>> address.
32 >> I can check on those. Thanks. I do notice one thing strange. Maybe a
33 >> cups bug. In the web interface when I created the printer in Athena, I
34 >> checked the box to say it was a shared printer. But when I look at the
35 >> status it says "not shared".
36 > Hmm ... what follows the commented line:
37 >
38 > # Restrict access to the server...
39 > <Location />
40 > Order Deny,Allow
41 > ... ?
42 >
43 > in the '/etc/cups/cupsd.conf' of Athena?
44 >
45
46 Here's the entire file. Although I fail to see what the allow/deny could
47 mean for a printer showing on Athena. It's not that Janus says it's not
48 a shared printer. It's ATHENA saying it's not shared, right after I
49 checked the box to make it shared.
50
51 # Configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
52 # complete description of this file.
53 #
54
55 # Log general information in error_log - change "warn" to "debug"
56 # for troubleshooting...
57 LogLevel debug
58 PageLogFormat
59
60 # Only listen for connections from the local machine.
61 Listen 192.168.10.2:631
62 Listen /run/cups/cups.sock
63
64 # Show shared printers on the local network.
65 Browsing On
66 BrowseLocalProtocols
67
68 # Default authentication type, when authentication is required...
69 DefaultAuthType Basic
70
71 # Web interface setting...
72 WebInterface Yes
73
74 # Restrict access to the server...
75 <Location />
76   Order allow,deny
77   allow 192.168.10.0/24
78 </Location>
79
80 # Restrict access to the admin pages...
81 <Location /admin>
82   Order allow,deny
83   allow 192.168.10.0/24
84 </Location>
85
86 # Restrict access to configuration files...
87 <Location /admin/conf>
88   AuthType Default
89   Require user @SYSTEM
90   Order allow,deny
91 </Location>
92
93 # Restrict access to log files...
94 <Location /admin/log>
95   AuthType Default
96   Require user @SYSTEM
97   Order allow,deny
98 </Location>
99
100 # Set the default printer/job policies...
101 <Policy default>
102   # Job/subscription privacy...
103   JobPrivateAccess default
104   JobPrivateValues default
105   SubscriptionPrivateAccess default
106   SubscriptionPrivateValues default
107
108   # Job-related operations must be done by the owner or an administrator...
109   <Limit Create-Job Print-Job Print-URI Validate-Job>
110     Order deny,allow
111     Allow 192.168.10.0/24
112   </Limit>
113
114   <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job
115 Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription
116 Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job
117 Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job
118 CUPS-Get-Document>
119     Require user @OWNER @SYSTEM
120     Order deny,allow
121   </Limit>
122
123   # All administration operations require an administrator to
124 authenticate...
125   <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer
126 CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
127     AuthType Default
128     Require user @SYSTEM
129     Order deny,allow
130   </Limit>
131
132   # All printer operations require a printer operator to authenticate...
133   <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer
134 Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs
135 Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer
136 Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs
137 CUPS-Accept-Jobs CUPS-Reject-Jobs>
138     AuthType Default
139     Require user @SYSTEM
140     Order deny,allow
141   </Limit>
142
143   # Only the owner or an administrator can cancel or authenticate a job...
144   <Limit Cancel-Job CUPS-Authenticate-Job>
145     Require user @OWNER @SYSTEM
146     Order deny,allow
147   </Limit>
148
149   <Limit All>
150     Order deny,allow
151   </Limit>
152 </Policy>
153
154 # Set the authenticated printer/job policies...
155 <Policy authenticated>
156   # Job/subscription privacy...
157   JobPrivateAccess default
158   JobPrivateValues default
159   SubscriptionPrivateAccess default
160   SubscriptionPrivateValues default
161
162   # Job-related operations must be done by the owner or an administrator...
163   <Limit Create-Job Print-Job Print-URI Validate-Job>
164     AuthType Default
165     Order deny,allow
166   </Limit>
167
168   <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job
169 Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription
170 Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job
171 Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job
172 CUPS-Get-Document>
173     AuthType Default
174     Require user @OWNER @SYSTEM
175     Order deny,allow
176   </Limit>
177
178   # All administration operations require an administrator to
179 authenticate...
180   <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer
181 CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
182     AuthType Default
183     Require user @SYSTEM
184     Order deny,allow
185   </Limit>
186
187   # All printer operations require a printer operator to authenticate...
188   <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer
189 Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs
190 Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer
191 Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs
192 CUPS-Accept-Jobs CUPS-Reject-Jobs>
193     AuthType Default
194     Require user @SYSTEM
195     Order deny,allow
196   </Limit>
197
198   # Only the owner or an administrator can cancel or authenticate a job...
199   <Limit Cancel-Job CUPS-Authenticate-Job>
200     AuthType Default
201     Require user @OWNER @SYSTEM
202     Order deny,allow
203   </Limit>
204
205   <Limit All>
206     Order deny,allow
207   </Limit>
208 </Policy>
209
210 # Set the kerberized printer/job policies...
211 <Policy kerberos>
212   # Job/subscription privacy...
213   JobPrivateAccess default
214   JobPrivateValues default
215   SubscriptionPrivateAccess default
216   SubscriptionPrivateValues default
217
218   # Job-related operations must be done by the owner or an administrator...
219   <Limit Create-Job Print-Job Print-URI Validate-Job>
220     AuthType Negotiate
221     Order deny,allow
222   </Limit>
223
224   <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job
225 Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription
226 Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job
227 Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job
228 CUPS-Get-Document>
229     AuthType Negotiate
230     Require user @OWNER @SYSTEM
231     Order deny,allow
232   </Limit>
233
234   # All administration operations require an administrator to
235 authenticate...
236   <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer
237 CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
238     AuthType Default
239     Require user @SYSTEM
240     Order deny,allow
241   </Limit>
242
243   # All printer operations require a printer operator to authenticate...
244   <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer
245 Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs
246 Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer
247 Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs
248 CUPS-Accept-Jobs CUPS-Reject-Jobs>
249     AuthType Default
250     Require user @SYSTEM
251     Order deny,allow
252   </Limit>
253
254   # Only the owner or an administrator can cancel or authenticate a job...
255   <Limit Cancel-Job CUPS-Authenticate-Job>
256     AuthType Negotiate
257     Require user @OWNER @SYSTEM
258     Order deny,allow
259   </Limit>
260
261   <Limit All>
262     Order deny,allow
263   </Limit>
264 </Policy>
265
266 > Similarly, check the "hosts allow" directive in the Samba configuration to
267 > include Janus' IP address.
268 Again, I think you're misunderstood the problem. Forget Janus for a
269 second. Forget Samba for a minute. I create a pinter via the CUPS web
270 interface on Athena. When it shows the box to make it shared, I check
271 the box. When I finish and the printer status appears, it says "not
272 shared". Other machines and other protocols have not even come into play
273 yet.
274
275 --
276 Dan Egli
277 On my test server

Replies

Subject Author
Re: [gentoo-user] Sharing printers via Cups Michael <confabulate@××××××××.com>