[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Print to Linux from Windows NT

Posted on 1998-06-15
Medium Priority
Last Modified: 2010-05-18
I have a recent installation of SAMBA which I would like to be able to print to from NT.  

I have looked at FAQ's, man pages, and web too long... It was working, but I mucked around with it and it isn't now.

Currently, when I try to print a test page from the Canon610, it says "Error writing to ...  Access denied.  Do you wish to retry or cancel the job?"

The samba-xxx.log doesn't seem to be very helpful...

Awaiting a linux guru...
Question by:loucks
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 3
  • 2
  • +8

Expert Comment

ID: 1584516
Access denied usually happens when the user you are logged into the samba server as doesnt have permission to print, make sure that you can print from the shell using the same account...

Author Comment

ID: 1584517
sorry, but it doesn't work...  

C:\>net use lpt3:  \\linuxdb\canon610 /user:loucks
The password is invalid for \\linuxdb\canon610.

Type the password for \\linuxdb\canon610:
System error 1240 has occurred.

The account is not authorized to login from this station.

that is what I got after I changed the smb.conf file to this:

; Security modes: USER uses Unix username/passwd, SHARE uses WfW type passwords
;        SERVER uses a Windows NT Server to provide authentication services
   security = USER
; Use password server option only with security = server

I previously had security set to SERVER and the server = to my domain controller.

Just as an aside, this is that happens when I try to stop the smb service as outlined at the top of smb.conf (start works fine):

# /etc/rc.d/init.d/smb stop
Shutting down SMB services: smbd kill: (1629) - No such pid
grep: 1629: No such file or directory
# /etc/rc.d/init.d/smb stop
Shutting down SMB services:

Eventually, I want to be able to print to the linux box using NT authentication.

LVL 32

Expert Comment

ID: 1584518
You're using NT w/SP3, right?

See this URL for details:

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.


Author Comment

ID: 1584519
Using NT/SP3 - applied fix above, now I can connect, but it still doesn't work...  Access denied...

From smbclient :
 print printer.prnt
 ERRDOS - ERRnoaccess (Access denied.)  opening printer for printer.prnt
LVL 32

Expert Comment

ID: 1584520
>From smbclient :
> print printer.prnt
> ERRDOS - ERRnoaccess (Access denied.)  opening printer for >printer.prnt

SMBCLIENT???  You said you wanted to print from NT!  Why don't you try printing from NT and show what is in the log file after that.

Author Comment

ID: 1584521
Yes Yes!!! I do want to print from NT...  But I thought the output of SMB client might be useful...  I can't even print from SMBClient on the same machine, so it is a linux Samba configuration problem, which has to do with access being denied.  From windows nt, it says "Access is denied" also...

This is when I try to print a test page to a port that has been mapped as below:
  net use lpt3:  \\linuxdb\canon610 /user:loucks
and enter my linux password for user loucks
The mapping goes ok...  

LVL 32

Expert Comment

ID: 1584522
From http://www.samba.bst.tj/samba/docs/faq/sambafaq-3.html#ss3.8 

The SAMBA documentation pages say to do ONE of these two things.  You appear to have done BOTH of them:


3.8 I've applied NT 4.0 SP3, and now I can't access Samba shares, Why?
As of SP3, Microsoft has decided that they will no longer default to passing clear text passwords over the network. To enable access to Samba shares from NT 4.0 SP3, you must do ONE of two things:

Set the Samba configuration option 'security = user' and implement all of the stuff detailed in ENCRYPTION.txt.
Follow Microsoft's directions for setting your NT box to allow plain text passwords. see Knowledge Base Article Q166730  


Author Comment

ID: 1584523
No, I have not implemented the instructions found in encryption.txt...  and the only reason I changed from security=server to security=user was to see if it was a problem with windows NT not giving authenticating passwords properly...  
Once again:  I can connect to the server and view the spool just fine, but when I try to print a test page, it hangs...


Author Comment

ID: 1584524
Now that I have been browsing my NT event logs, when I try to connect to the linux box, my NT server says in the event log
"unknown user name or bad password", so this is a configuration problem of linux / samba to get authentication from NT?
LVL 51

Expert Comment

ID: 1584525
You want to use your NT's DC as authentication server. I asume that you then do not have the users in the linux's passwd.

If so,  man smb.conf  suggest:

server = SHARE

BTW, there are a couple of parameters in smb.conf which could produce your authentication failture, for example:
  username map
  valid users
  invalid users
  only user

Also remember that the netbios name of your DC must be listed in /etc/hosts (I'm not shure if it is case-sensitive, in doubt uppercase).

Author Comment

ID: 1584526
You are right, users are not in linux's passwd.

Do you mean server = SHARE or security = SHARE?  I don't have any of those other parameters active in smb.conf.  

Please see my other question in this same topic area which might give you more clues as to what I have messed up...
LVL 51

Expert Comment

ID: 1584527
serurity = SHARE

I'll check some things with samba and NT and then be back on this question and the other one.

Author Comment

ID: 1584528
well, with security = SHARE, smb.conf man page tells me I should only have password server when security = SERVER.  I don't think the listing in /etc/hosts is a problem because I am using DNS for netbios name resolution and the NT Server (not client) event log says that the username couldn't log on to the linux box.

But I will set security = SHARE if you think that will help.

Expert Comment

ID: 1584529
Just on a tangent......

but it sounds like life would be much simpler if you just install a lpr spooler on the NT box, and configure Linux box to only accept print jobs from NT...

.but I digress...

Expert Comment

ID: 1584530
why don't you use Microsoft TCP/IP Printing service ?

Author Comment

ID: 1584531
in answer to squint and jprohart:

I used to have my server printing to an lpd black box.  I thought:  "Gee, wouldn't it be nice if the print job didn't have to hit the network twice?".  So I set up a workstation on very old hardware to be the print server for my two main printers.   The clients keep losing the printer box (seems to happen most with WP Win 6.1).

So, my favorite professor here at the university said "Linux can do all that and more!"   So, I had an extra 5 gig harddrive laying around and decided to use it as a print spooler / online backup server.

We got the linux box to accept print jobs once.  Then I tried to add another printer port and now it won't accept print jobs.  I know it is possible because it did work for a few short minutes before I threw in the second parallel port.

I want to do this because it should be possible.

Expert Comment

ID: 1584532
please post your smb.conf and your printcap file in /etc/ here.

Expert Comment

ID: 1584533
The answer here that I will provide does not use Samba at all.  I assume that you have set up lpd and can lpr files on the linux box.

First of all you will need your NT CD (You do have that don't you?)

TCP/IP Printing in Windows NT
              1.Open the Network Control Panel
              2.Click the Services tab
              3.Click ADD
              4.Choose "Microsoft TCP/IP Printing"
              5.It will ask for the location of the NT CDROM, use the CDROM
              6.Apply the changes and reboot
              7.Go to the Printer Control Panel
              8.Add A Printer
              9.Choose "My Computer"
             10.Choose "Add A Port"
             11.Choose "LPR Port"
             12.For the server name put the name of your linux box
                  For the queue name, put the name of the queue you have setup on the
                  linux box
             13.Click OK, then NEXT
             14. From here out you would then choose the stuff that applies to your printer
                   and in a few clicks you should be on your way to printing!

For info on setting up lpd, see the HOWTO's =)

Author Comment

ID: 1584534
No, read my answer to squint and jprohart...  I don't want stuff going over the network a million times before it gets printed.

Expert Comment

ID: 1584535
Actually, using TCP/IP printing won't cause any more traffic than using SAMBA.

Author Comment

ID: 1584536
Actually, it would.  Once to NT machine that spools to LP and once from that machine to the LPD.  2 times.

The way I want it:   Once to the linux box that prints it.  1 time.  

I am not a complete idiot.   (Pretty close, but not complete).  And no, I don't want to go around to all my machines installing TCP/IP printing services.  In this question, I am not asking how can I do something, but how can I do THIS?!

Expert Comment

ID: 1584537
Also take a look at John Blair's excellent book on Samba. You will especially want to try running testparm with the options he specifies to test as if you were connecting from that machine for testing printing services.

I will bring in the book tomorrow and provide more info.

Accepted Solution

henckens earned 600 total points
ID: 1584538
For WinNT you need to use a the samba password file for authentication.  So the user the NT client wants to use must in there to get authenticated.  Mostly in /usr/local/samba/private


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question