Communauté Informatique NDFR.net

Communauté Informatique NDFR.net (http://www.ndfr.net/forums/index.php)
-   Unix/Linux Client (http://www.ndfr.net/forums/forumdisplay.php?f=53)
-   -   Problème de partage imprimante avec Samba/CUPS (http://www.ndfr.net/forums/showthread.php?t=6235)

KnuX 13-05-2005 19:23

Problème de partage imprimante avec Samba/CUPS
 
Salut à tous,

J'ai un problème sur mon réseau qui commence à me travailler, ça concerne le partage de ma belle imprimaite HP Deskjet 5150.

Ma machine, où est connectée l'imprimante, tourne sous Debian Sid. Les autres machines sont des Windows XP et parfois un Windows 2000 (sous VMware :D).

L'imprimante est partagée, et visible. Cependant, sous Windows 2000 son "Etat" est à "Accès refusé, impossible de se connecter" et sous Windows XP c'est "Accès refusé. Connexion impossible."

Paradoxalement, si j'ouvre notepad et que j'imprime, ça marche sans aucun souci...

Quelques fois, au lieu de sortir une page imprimée j'ai une page blanche, ou lorsque j'imprime à partir de Word les caractères ne sont pas espacés correctement. Par exemple "Ceci est une phrase de test" devient facilement "Ceci est un ephrased e t est".

Je vous met ici mon smb.conf, en espérant que quelqu'un trouve ce qui m'échappe vraiment ;)

Quote:

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentary and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not many any basic syntactic
# errors.
#

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = workgroup

# server string is the equivalent of the NT Description field
server string = %h server (Samba %v)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
; wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast


#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
; syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/ServerType.html in the samba-doc
# package for details.
; security = user

map to guest = bad user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam guest

obey pam restrictions = yes

; guest account = nobody
invalid users = root

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
; unix password sync = no

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Augustin Luton <aluton@hybrigenics.fr> for
# sending the correct chat script for the passwd program in Debian Potato).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
; pam password change = no


########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
printing = cups
printcap name = cups

# When using [print$], root is implicitly a 'printer admin', but you can
# also give this right to other users to add drivers and set printer
# properties
; printer admin = @ntadmin


######## File sharing ########

# Name mangling options
; preserve case = yes
; short preserve case = yes


############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
; domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

#======================= Share Definitions =======================

[homes]
comment = Home Directories
browseable = no

# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
writable = no

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no

[printers]
comment = All Printers
browseable = no
path = /tmp
printable = yes
public = no
writable = no
create mode = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
; write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; writable = no
; locking = no
; path = /cdrom
; public = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom
Merci d'avance pour votre aide, elle sera précieuse quoiqu'il en soit :)

Fred 13-05-2005 20:11

Essaye de mettre ces lignes :
security = user
hosts allow = 192.168.0. 127.

Et dans ta section printers :
public = yes

Sinon c'est toujours une bonne idée de mettre un petit partage de fichiers pour tester, ça t'évite les problèmes supplémentaires de Cups pour tester ton partage.

KnuX 13-05-2005 22:42

Même résultat, j'ai rajouté un partage bidon aussi ça ne peut que m'aider :)

Actuellement j'ai donc :
Quote:

[global]
workgroup = workgroup
server string = %h server (Samba %v)
dns proxy = no
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d

security = user
hosts allow = 192.168.1. 127.

map to guest = bad user

encrypt passwords = true
passdb backend = tdbsam guest

obey pam restrictions = yes

; guest account = nobody
invalid users = root

passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .

load printers = yes

printing = cups
printcap name = cups

socket options = TCP_NODELAY
[homes]
comment = Home Directories
browseable = no
writable = no
create mask = 0700
directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /tmp
printable = yes
public = yes
writable = no
create mode = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

[temp]
comment = Temp
path = /home/knux/temp
guest ok = yes
writable = no
browseable = yes
Je vous tiens au courant de mes recherches, et je suis toujours preneur lol :(

Edit :
- Rectification, je ne sais comment, l'impression est désormais bonne malgré l'"Accès refusé" affiché (à tort :() sous Windows 2000.
- Et pour corser les choses, c'est mon Windows XP qui a décidé de m'ennuyer en me demandant un login/pass pour accéder à la machine... Surtout que ça marche si je met un login bidon comme "f", et qu'ensuite il me met un état "Prêt" à l'imprimante :confused:

Ca avance, merci :)

KnuX 14-05-2005 12:51

Ayant rencontré le problème d'impression de certaines polices ce matin, je suis retombé sur mon smb.conf retravaillé par drakconf et j'ai repris cette partie :
Quote:

# =====================================
# print command: see above for details.
# =====================================
print command = lpr-cups -P %p -o raw %s -r # using client side printer drivers.
# print command = lpr-cups -P %p %s # using cups own drivers (use generic PostScript on clients).
# If you install drivers on the server, you will want to uncomment this so
# clients request the driver
# use client driver = yes
J'ai désormais une impression bonne à tous les coups que j'ai pu essayer :)

Par contre, mon Windows XP me demande toujours un login/pass sous mon compte administrateur mais par sur les comptes utilisateurs (étrange ?).

On s'en rapproche ;)

Fred 14-05-2005 17:03

Normalement la directive :
public = yes

Dans les sections de partage de fichiers et d'imprimante doivent laisser l'accès normal.

Par contre cette directive m'inquiète un peu, tu pourrais essayer de la commenter :
map to guest = bad user

Essaye ça :
Quote:

[global]

; Configuration générale
workgroup = workgroup
server string = Serveur de Knux
dns proxy = no
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
; Fichier log à spécifier, %m = nom de l'hôte qui se connecte
;log file = /usr/share/samba/var/log.%m

; Authentification
security = user
hosts allow = 192.168.1. 127.

; Imprimante
load printers = yes
printing = cups
printcap name = cups

; Performance (pour Linux uniquement)
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

; Pour accélérer le groupe de travail
; A n'activer que si le serveur est dispo H24
local master = yes
os level = 10
domain master = yes
preferred master = yes
wins support = yes

[print$]
; Configuration de l'imprimante
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
only guest = yes
public = yes

[temp]
comment = Temp
path = /home/knux/temp
writable = yes
browseable = yes
public = yes
only guest = yes
printable = no

KnuX 14-05-2005 20:59

Avec cette conf, les deux machines demande un mot de passe pour accéder au samba.

Ce que je cherche à faire, c'est permettre à mes machines de voir l'imprimante et l'exploiter sans avoir à fournir un login/pass. En gros, l'imprimante est un partage public ;)

C'est là que le "security = user" me chagrinerait en fait, je suis forcé d'ajouter les utilisateurs avec smbpasswd ?

Merci pour ton aide Fred ;)

KnuX 14-05-2005 22:41

Bon donc actuellement j'ai une configuration qui marche sans demander de mot de passe.
Quote:

[global]
workgroup = workgroup
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d

security = share
hosts allow = 192.168.1. 127.

encrypt passwords = true
passdb backend = tdbsam guest

obey pam restrictions = yes

invalid users = root
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
load printers = yes
printing = cups
printcap name = cups
socket options = TCP_NODELAY

[homes]
comment = Home Directories
browseable = no
writable = no
create mask = 0700
directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /tmp
printable = yes
public = yes
writable = no
create mode = 0700
# =====================================
# print command: see above for details.
# =====================================
print command = lpr-cups -P %p -o raw %s -r # using client side printer drivers.
# print command = lpr-cups -P %p %s # using cups own drivers (use generic PostScript on clients).
# If you install drivers on the server, you will want to uncomment this so
# clients request the driver
# use client driver = yes

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

[temp]
comment = Temp
path = /home/knux/temp
guest ok = yes
writable = no
browseable = yes
J'ai mis security = share, je pense que c'est approprié à mon utilisation non ?

Par contre, sous Windows 2000 j'ai toujours l'état en "Accès refusé" mais sous Windows XP elle est "Prêt". Je pense ne pas m'acharner encore plus longtemps sur ce qui me semble être une erreur de protocole... Surtout que ça imprime même si la première impression se matérialise en une simple feuille blanche ;)

Fred 15-05-2005 01:11

Sur la machine XP ça imprime sans problème ?
Tente un "public = yes" dans tes deux dernières sections.

KnuX 15-05-2005 21:04

Sur la machine XP, ça imprime sans aucun problème, et je viens de m'apercevoir que là j'ai "Accès refusé. Connexion impossible" en état ;)

Bref, actuellement les impressions fonctionnent, cet état m'importe très peu !

J'ai rajouté les public = yes :)

Pour info : Samba version 3.0.14a-Debian

KnuX 12-06-2005 16:18

Et pour la lenteur d'impression, a priori j'ai trouvé quelque chose...

J'ai voulu imprimer un dossier de 55 pages sous Word sur un Windows 2000, et ça avance à un rythme de 2 pages par minutes (voire pire :() et l'impression ne débute pas tant que les 55 pages n'ont pas été transmises.

J'ai donc eu l'idée d'aller voir du côté de mon /var/log/samba/log.win2k :
Quote:

[2005/06/12 16:16:07, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:07, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:07, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:08, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:08, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:09, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:09, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:10, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:10, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:10, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/12 16:16:11, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
Ca imprime, certes, après un transfert laborieux. Pour l'instant je n'ai encore rien trouvé, si quelqu'un avait une idée... ;)

Pour information :
- Document de 55 pages
- Lancement de l'impression : 15h53
- Fin du transfert : 16h28
- Impression de la première feuille : 16:28

Ca fait long non ? ;)

Fred 12-06-2005 20:49

Peut-être un souci réseau, regarde les quelques tweaks :
# Most people will find that this option gives better performance.
# See the chapter 'Samba performance issues' in the Samba HOWTO Collection
# and the manual pages for details.
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

Sinon, essaye de splitter tes logs (ajouter %m au nom de log pour en avoir un par machine) pour savoir si c'est vraiment de ce Windows 2000 que ça vient.

KnuX 12-06-2005 21:13

En socket_options je n'ai que :
Quote:

socket options = TCP_NODELAY
Une impression a été lancée du PC de mon frère (mandrake), et je ne vois pas une seule erreur (les logs sont déjà suffixés du nom de la machine)

Je vais essayer les options proposées en commentaire (les mêmes que les tiennent) et je verrais ce que ça donnera sur la prochaine impression ;)

KnuX 19-06-2005 23:14

Quote:

[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:34, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
[2005/06/19 23:11:35, 0] rpc_server/srv_lsa_hnd.c:create_policy_hnd(111)
create_policy_hnd: ERROR: too many handles (1025) on this pipe.
Bon et bien, nous avons notre réponse, le tuyau et encore trop sollicité :(

KnuX 25-09-2005 12:28

Ayant vu sur un site que Windows 2000 pouvant directement communiquer avec une imprimante configurée sur un serveur CUPS (via le protocole "ipp://"), au revoir Samba ;)


All times are GMT +2. The time now is 14:01.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.