LinuxForum.Fans
Тема

Не получается подключится к http://192.168.0.1:631/printer

Автор: kosik 15 сообщений 7767 просмотров
#317478

Начал было делать принт-сервер.
Подключил один сетевой принтер, тестовая печать на него с SuSE прошла нормально.
С нее же на http://localhost:631/printer заходит нормально.
Но с машин из локалки на http://192.168.0.1:631/printer не пускает и рекомендует обратиться к администратору.
Фаервол отрубил, но легче не стало

#317479

Покажите /etc/cups/cupsd.conf.
А что пишется в логи, к примеру, в /var/log/cups/error_log (или подобный)?

#317480

Я его не трогал. так что он дефолтный:

cupsd.conf

Показать

#
# "$Id: cupsd.conf.in 9310 2010-09-21 22:34:57Z mike $"
#
# Sample 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

# Administrator user group...
SystemGroup sys root


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

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS

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

# Restrict access to the server...
<Location />
Order allow,deny
Allow 127.0.0.2
</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>

# Set the default printer/job policies...
<Policy 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 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 Ac
tivate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After 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-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 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 Ac
tivate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After 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>

#
# End of "$Id: cupsd.conf.in 9310 2010-09-21 22:34:57Z mike $".
#

# The policy below is added by openSUSE/Novell during build of our cups package.
# The policy 'allowallforanybody' is totally open and insecure and therefore
# it can only be used within an internal network where only trused users exist
# and where the cupsd is not accessible at all from any external host, see
# http://en.opensuse.org/SDB:CUPS_and_SANE_Firewall_settings
# Have in mind that any user who is allowed to do printer admin tasks
# can change the print queues as he likes - e.g. send copies of confidental
# print jobs from an internal network to any external destination, see
# http://en.opensuse.org/SDB:CUPS_in_a_Nutshell
# For documentation regarding 'Managing Operation Policies' see
# http://www.cups.org/documentation.php/doc-1.4/policies.html
<Policy allowallforanybody>
<Limit All>
Order deny,allow
Allow from all
</Limit>
</Policy>
# Explicitly set the CUPS 'default' policy to be used by default:
DefaultPolicy default
# End of additions by openSUSE/Novell.


#317481

Попробуйте на сервере чуть изменить настройки

text
<Location />
   Order allow,deny
   Allow localhost
   Allow 192.168.0.*
</Location>
text

Listen localhost:631
Listen /var/run/cups/cups.sock
Listen 192.168.0.1:631

На компьютере-клиенте в файл /etc/cups/client.conf

text
ServerName 192.168.0.1
#317483

Завтра попробую и отпишусь.

Компьютеры-клиенты все под виндой.

#317511
"kosik⇓" написал:
Подключил один сетевой принтер

Сетевой принтер подключён напрямую в сеть или через компьютер с OpenSUSE?

#317564

basileus,
Под сетевым принтером понимался принтер с собственной сетевой картой и IP-адресом.
Цель - создать управляемую очередь посредством CUPS (по не проверенным слухам он умеет такое делать)


Lupo Alberto,
Внес правки, но все равно не дает подключиться *WALL*
Ни с виндовой доменной машины, ни с другой линуксовой.
В логах можно сказать чисто - обругалось лишь на строки с 192.168.0.* (* в качестве обозначения подсетки считает ошибкой)

#317565
"kosik⇓" написал:
Внес правки, но все равно не дает подключиться

Покажите дословно вывод ошибки.

#317567

Дословно было только это:

Показать

[CGI] Saw EOF, expected '}'!
[CGI] Saw EOF, expected '}'!
[CGI] Saw EOF, expected '}'!
[CGI] Saw EOF, expected '}'!
Hostname lookup for "10.95.*.*" failed!
Bad Listen address 10.95.*.*:631 at line 19.
[CGI] Saw EOF, expected '}'!
[CGI] Saw EOF, expected '}'!
[CGI] Saw EOF, expected '}'!
[CGI] Saw EOF, expected '}'!
Hostname lookup for "10.95.*.*" failed!
Bad Listen address 10.95.*.*:631 at line 19.

после задания конкретных IP:

Показать

Listening to ::1:631 on fd 4...
Listening to 127.0.0.1:631 on fd 6...
Listening to /var/run/cups/cups.sock on fd 7...
Unable to bind socket for address 10.95.13.2:631 - Cannot assign requested address.
Unable to bind socket for address 10.95.13.3:631 - Cannot assign requested address.
Unable to bind socket for address 10.95.7.152:631 - Cannot assign requested address.
Resuming new connection processing...
cupsdRegisterPrinter(p=0xb78486e8(HP_LaserJet_8150))
Discarding unused server-started event...
Report: clients=0
Report: jobs=1
Report: jobs-active=0
Report: printers=1
Report: printers-implicit=0
Report: stringpool-string-count=3242
Report: stringpool-alloc-bytes=8400
#317568

А покажите все файлы, которые есть в /etc/cups, а то...

"kosik⇓" написал:

Unable to bind socket for address 10.95.13.2:631 - Cannot assign requested address.
Unable to bind socket for address 10.95.13.3:631 - Cannot assign requested address.
Unable to bind socket for address 10.95.7.152:631 - Cannot assign requested address.

...непонятно, откуда это берётся.

#317569

P.S. Все компьютеры, т.е. принт-сервер и клиенты, находятся в одной подсети?

#317570

В cups.conf измени Listen localhost:631 на Listen 0.0.0.0:631

Должны пропасть тогда ошибки

Unable to bind socket for address 10.95.13.2:631 - Cannot assign requested address.

и может запечатают виндовые тачки.

З.Ы. Порты не блочишь случайно, фаирвол работает?

#317571

Да, маска /20

#317577

XliN,
Да, это помогло...
Но при таком раскладе доступ к очереди будет иметь любой компьютер локалки.

#317598

Где стоит капс, как вариант, закрыть этот порт и открыть его только нужным.

Просто и без заморочек.

Войдите или зарегистрируйтесь, чтобы ответить.