# Cannot access Windows printer from Gentoo machine [Solved]

## mcuddy

I am trying to use samba to print to a printer shared by a windows XP computer. I can access it with another windows computer on the workgroup, but not with my gentoo machine. I have the workgroup (mshome) the same in smb.conf and on windows machine. I can ping the windows machine (#ping jrcuddy1) and get the list of shares with #smbtree and "#smbclient -L jrcuddy1". The cups Device URI is smb://JRCUDDY1/Hp21725. When I try to print, I get "Unable to connect to CIFS host"

Any ideas?Last edited by mcuddy on Thu Apr 28, 2011 11:01 pm; edited 1 time in total

----------

## MotivatedTea

Is a password required for the printer share? (If you're using the same account on both Windows machines, you won't be asked for a password because Windows will supply it automatically.) Try changing the URL to "smb://username:password@JRCUDDY1/Hp21725", replacing "username" with the name of an account on the Windows machine that is allowed to print, and "password" with that account's password. NOTE: The username and password will be stored in plain text in one of the .conf files under /etc/cups. (I don't remember which one; I'm not using a password-enabled Windows printer at the moment.) You should identify which file that is and run "chmod go-r" on it to remove group and world read rights.

Also try turning up your LogLevel in /etc/cups/cupsd.conf, restart cups, and look for anything relevant in your logs under /var/log/cups.

If you have administrative rights on the XP machine, the other thing you could try is to change the permissions on the printer share so that no password is required. While logged in as an administrator, go to Start > Settings > Printers. Right-click on the printer and select Properties. Check the Sharing tab to make sure it is shared, and that you have the share name right. Then go to the Security tab. In the top pane, select the group "Everyone" (add it if it's missing). With the "Everyone" group selected, check the Allow box for "Print". Then click OK and try to print again. If you do this, you shouldn't need to use a username and password from CUPS (or anywhere else).

----------

## mcuddy

No password required - the two machines use different user names, and neither use passwords

From the error log, it seems to be looking at an IPP address on my local computer. Is this normal? There are other notes about "Resume-Printer:Unauthorized" and "Tree connect failed (NT_STATUS_BAD_NETWORK_NAME)"

error_log info. There was a lot of it, but I think these are the important pieces:

 *Quote:*   

> D [27/Apr/2011:22:47:21 -0700] [CGI] op="start-printer"...
> 
> D [27/Apr/2011:22:47:21 -0700] cupsdReadClient: 14 POST /admin/ HTTP/1.1
> 
> D [27/Apr/2011:22:47:21 -0700] cupsdAuthorize: No authentication data provided.
> ...

 

 *Quote:*   

> D [27/Apr/2011:22:47:31 -0700] cupsdCloseClient: 14
> 
> D [27/Apr/2011:22:47:31 -0700] PID 5945 (/usr/libexec/cups/cgi-bin/printers.cgi) exited with no errors.
> 
> D [27/Apr/2011:22:47:31 -0700] [Job 18] Page = 595x842; 18,36 to 577,833
> ...

 

 *Quote:*   

> D [27/Apr/2011:22:48:24 -0700] cupsdAuthorize: No authentication data provided.
> 
> D [27/Apr/2011:22:48:24 -0700] cupsdSendError: 17 code=304 (Not Modified)
> 
> E [27/Apr/2011:22:48:33 -0700] [Job 18] Tree connect failed (NT_STATUS_BAD_NETWORK_NAME)
> ...

 

----------

## MotivatedTea

The "NT_STATUS_BAD_NETWORK_NAME" is a frustratingly generic SAMBA error message. It most often seems to mean that either the machine name or the share name is wrong. First double-check that "Hp21725" is actually what is listed in the output of "smbclient -L" under the "ShareName" column. Also, when you say you can ping jrcuddy1, how did you accomplish that? Since I don't run my own nameserver, I usually do that by editing /etc/nsswitch.conf and adding "wins" to the end of the "hosts:" line. Did you do something differently? You could also try using the server's IP address instead of "jrcuddy1" temporarily. If you're using DHCP, that's obviously not a good long-term solution, but it might help confirm whether or not name resolution is part of your problem.

----------

## mcuddy

OK, I feel like a total ditz! it was Hp2175, not Hp21725. I changed everything around it, but missed the resource name...  Thank you for all of the help

----------

