5

I am running the CUPS in Linux Debian machine. Using the CUPS I am sending the print request to Windows XP machine. I have enabled the 445 and 139 port and I am able to connect the Windows Machine. Printer is connected to the Windows Machine.

I am sending the print request using the following command

lp -E -d < Printer Name > file name. 

After sending I am checking the printer status using the following command

lpstat -p < Printer Name > 

I am getting the below error message when I execute the above message.

unable to connect to cifs host will retry in 60 seconds.. 

When I checked in the log I am getting the below error message.

session setup failed: NT_STATUS_LOGON_FAILURE  and NT_STATUS_BAD_NETWORK_NAME

The DeviceURI is like below in /etc/cups/printers.conf

 smb://username:password@IP Address of windows Machine/printer_Name

Please let me know if the password is having '@' symbol, how can we specify the '@' with actual syntax in DeviceURI ( user:password@IP )

1 Answer 1

4

Unfortunately you provide not enough detailed info about your specific setup. So I will make an effort to take several potential problems into account and give hints how to overcome them:

I.

Did you use the correct share name for your shared Windows printer?

To find out, use this command:

$ smbtree -U windowsusername

You might see something like the following output:

WORKGROUP
   \\MURUGA-PC
      \\MURUGA-PC\G
      \\MURUGA-PC\Z
      \\MURUGA-PC\Public
      \\MURUGA-PC\print$                      Printer Drivers
      \\MURUGA-PC\EPSON Stylus CX8400 Series  EPSON Stylus CX8400 Series

In other words: your printer's share name may contain spaces. But you cannot use spaces in the device URI for CUPS! What now?

Easy: (1) Either rename the share name on the Windows side. (2) Or escape the space by using %20 instead:

smb://muruga:mysecretpassword@muruga-pc/EPSON%20Stylus%20CX8400%20Serie

II.

Is your Windows XP by any chance using Kerberos authentication? For example, because it is part of an Active Directory environment? Then you should refer to this document on cups.org:

Kerberos authentication does not work with username/password, it uses 'tickets'.


III.

Otherwise, if your Windows XP machine is part of a "standard" domain, you may be more successful by ditching your device URI of smb://username:password@ip-address-of-windows/printer_name and use this instead:

smb://username:password@domain_name/windows_host/printer_Name

The username you use has to be the Windows user name (with his/her password) who installed the printer on Windows!


IV.

Alternatively, you may have success by using IPP to print to Windows (though XP needs an IPP-enabling extension installed, provided by Microsoft). Be aware that MS is using a non-standard syntax for their device URIs (using port 80 or 443), and their version of IPP is still 1.0 (which always remained in "draft" status and never made it into an official release by the IETF):

DeviceURI https://mywindowsprintserver/printers/printername/.printer

or

DeviceURI http://mywindowsprintserver/printers/printername/.printer

For username/password authentication to this printer, you need

  1. AuthInfoRequired username,password in /etc/cups/printers.conf and
  2. DefaultAuthType Basic in cupsd.conf.

To use Kerberos, you need

  1. AuthInfoRequired Negotiate in /etc/cups/printers.conf and
  2. DefaultAuthType Negotiate in cupsd.conf.

If the whole setup is in a household with a private LAN/WLAN, you may want to consider removing all access controls (first on the Windows print server side, then):

  1. AuthInfoRequired None in /etc/cups/printers.conf and
  2. DefaultAuthType None in cupsd.conf.

If your problem is that your password contains a '@'-character, then try this:

smb://username:'p@ssword'@domain_name/windows_host/printer_Name

or

smb://username:p%40ssword@domain_name/windows_host/printer_Name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.