Hi, PROBLEM : I'm not able to use the printer connected to a windows 2000 machine. INSTALLATION: I have 3 PCs. - One is a windows 2000 PC with the printer connected to it - One is a redhat machine - One is a Suse 9.0 machine. The redhat machine is able to print to the samba printer, not the Suse one. smbclient -L //secretariat shows identical data on both Linux machines Domain=[TUX-NET] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager] Sharename Type Comment --------- ---- ------- IPC$ IPC Remote IPC D$ Disk Default share print$ Disk Printer Drivers HPLaserJ Printer HP LaserJet 4 ADMIN$ Disk Remote Admin C$ Disk Default share Server Comment --------- ------- SECRETARIAT Workgroup Master --------- ------- TUX-NET SECRETARIAT on the Suse machine this command line prints "ouf" to the printer correctly.
echo -en "\rouf\r\f" | smbclient "//secretariat/HPLaserJ" "tugudu" -c 'print -' -N -U "denis"
In other words everything works but I'm not able to create a printer connection with Yast2. When I lookup hosts it gives the IP of the windows machine and never accept the queue name (HPLaserJ) Ideas ? thanks Denis
Hello, On Dec 2 13:51 denis wrote (shortened):
PROBLEM : I'm not able to use the printer connected to a windows 2000 machine. ... on the Suse machine this command line prints "ouf" to the printer correctly.
echo -en "\rouf\r\f" | smbclient "//secretariat/HPLaserJ" "tugudu" -c 'print -' -N -U "denis"
Then all you need to do is to make sure that the matching DeviceURI is used in /etc/cups/printers.conf
In other words everything works but I'm not able to create a printer connection with Yast2. When I lookup hosts it gives the IP of the windows machine
This is an error in YaST caused by wrong autodetection because the IP is meaningless in the NetBIOS name space. As there is a lot of confusion with NetBIOS name space and DNS name space, we made the following support database article attached below which will become public available soon. Kind regards Johannes Meixner ----------------------------------------------------------- SUSE LINUX AG, Deutschherrnstr. 15-19 Mail: jsmeix@suse.de 90429 Nuernberg, Germany WWW: http://www.suse.de/ ----------------------------------------------------------- ###################################################################### Printing via SMB (Samba) Share or Windows Share =============================================== Applies to: SUSE LINUX 9.0 Situation ========= You want to print on a printer that is connected to an SMB host i.e. a printer that can be addressed over the network via a SMB host. Background Information ====================== An SMB host is a host that can be addressed by means of the SMB protocol. Normally, this is a Windows host. However, it can also be a Linux host running the "Samba" service. In order to be able to address the printer by means of the SMB protocol, the SMB host must have a "share" for this printer. The printer share is identified by unique "names" in the network: * Host name of the SMB host (always needed). * Name of the shares (always needed). * Name of the "workgroup" (not always needed). Additionally, a user name and a password may be necessary in order to gain access to the printer share. These names, which are required by the SMB protocol, are managed by the NetBIOS name service, which must be clearly distinguished from the usual DNS name service in TCP/IP networks. Though the SMB protocol is based on the TCP/IP protocol, the SMB protocol uses NetBIOS instead of DNS as name service. Therefore, the NetBIOS host name can be different from the DNS host name. Usually, however, the NetBIOS host name and the DNS host name are identical. Whatever the case may be, the DNS domain does not make any sense in the NetBIOS name space; accordingly, the fully qualified DNS host name consisting of the DNS host name and DNS domain does not make any sense in the NetBIOS name space. When a printer is addressed by a Linux host by means of the SMB protocol, this is merely for data transfer. The SMB host does not convert the print data from the applications (e.g., PostScript) to printer-specific data. Therefore, the filtering must take place on the Linux host, which requires a full-fledged print system on the Linux host. A queue with filtering must be set up on the Linux host. After the data is filtered, the queue sends the printer-specific data to the SMB share. The SMB share receives the printer-specific data and forwards them to the printer associated with the share. Procedure ========= Required packages: ------------------ * The package "samba-client" is needed for sending data (printer data) to an SMB share. * Additionally, a complete print system (CUPS or LPRng/lpdfilter) is needed. Determining the NetBIOS names: ------------------------------ The command "nmbstatus" lists the workgroups available in the network and the respective NetBIOS host names, e.g.: user@host> nmbstatus Found 123 hosts. Collecting additional information. Please wait. ... WORKGROUP TUX-NET MEMBERS GEEKO TUX ... Determining the available shares: --------------------------------- The command "smbclient -L NetBIOS-hostname -N" lists available shares on the SMB host with the specified NetBIOS host names, e.g.: user@host> smbclient -L GEEKO -N ... Sharename Type Comment --------- ---- ------- LPT1 Printer ... If necessary, add "-U username%password" to list shares that require a user name and a password for the access: smbclient -L GEEKO -U USER%PASSWORD -N Testing if the printer can be accessed via the SMB share: --------------------------------------------------------- The following command sends one carriage-return character "\r" to the printer via the SMB share. Nothing is printed, but possibly the printer may eject an empty page. echo -en "\r" | smbclient "//NetBIOS-hostname/share" -c "print -" -N Insert the respective NetBIOS host name and the share. If necessary, a workgroup and/or a user name and a password can be added to the smbclient command: smbclient "//NetBIOS-hostname/share" "password" -c "print -" \ -N -U "username" -W "workgroup" If the printer is able to print ASCII text directly (without filtering), the echo command can be replaced by the command echo -en "\rHello\r\f" in order to print the word "Hello". The entire command sequence could look as follows: echo -en "\rHello\r\f" | smbclient "//NetBIOS-hostname/share" "password" \ -c "print -" -N -U "username" -W "workgroup" Insert the correct NetBIOS host name and share. If necessary, insert the password, user name, and workgroup. The correct DeviceURI for CUPS: ------------------------------- In CUPS, the DeviceURI in /etc/cups/printers.conf determines how the data are to be sent to the printer (or to the SMB share). The DeviceURI must be as specified in "man smbspool": · smb://server/printer · smb://workgroup/server/printer · smb://username:password@server/printer · smb://username:password@workgroup/server/printer "server" refers to the NetBIOS host name, and "printer" refers to the share. The values for "server" and "printer" (and for "username", "password", and "workgroup", if necessary) must correspond to those used in the above command for the NetBIOS host name and share (and for the password, user name, and workgroup, if necessary). Configuration with YaST in SUSE LINUX 9.0: ------------------------------------------ The configuration in YaST causes problems, especially if a workgroup is entered. The safest way is to enter the values for * Server (NetBIOS host name) * Printer (share) and, if necessary, for * Workgroup * User name * Password in the YaST dialog in same way as they were used in the above smbclient command, provided that the smbclient command worked correctly. Then continue without testing the SMB access. In the final stage, print the YaST test page to check if all components (i.e. the SMB access and the filtering) work correctly. Explanation of the current problems in YaST: -------------------------------------------- 1. Confusion of NetBIOS names and DNS names or IP address: In the above entry, YaST does not set the NetBIOS host name as "Server". Rather, it wrongly uses the DNS host name and the DNS domain when starting the automatic detection. The NetBIOS host name usually corresponds to the DNS host name, but the DNS domain does not make any sense for SMB. 2. A faulty test script for testing the SMB access when using a workgroup: In this case, an error message such as the following appears in YaST: There was a problem. Your network access is not properly configured ... ... Check the host name of the print server ... even though all entries are correct, which of course is confusing. The test script /usr/lib/YaST2/bin/test_remote_smb can easily be corrected by replacing the lines [ -z "$WORKGROUP" ] || HOST="$WORKGROUP/$HOST" echo -en "\r" | smbclient "//$HOST/$QUEUE" "$PASSWORD" ... with the following lines: echo -e "\nTesting $QUEUE on $WORKGROUP $HOST:" echo -en "\r" | smbclient "//$HOST/$QUEUE" "$PASSWORD" -c "print -" \ -N -U "$USER" -W "$WORKGROUP" ######################################################################
participants (2)
-
denis
-
Johannes Meixner