Printing from a windowsXP box to a Linux machine - "Access denied"


Page 1 of 3 123 LastLast
Results 1 to 15 of 31

Thread: Printing from a windowsXP box to a Linux machine - "Access denied"

  1. #1
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642

    Printing from a windowsXP box to a Linux machine - "Access denied"

    Their seem to be hundreds of posts on this same problem, but no solutions...

    I need to first know if it is possible to print from a Windows XP box to a Linux box with a (cups) configured printer.

    As for the usual details...

    Yes, the printer is configured correctly with cups - I can print fine on the Linux box.

    File sharing works fine - I can share files both ways on the network between the Linux and XP boxes

    And I can add the printer on the win box fine - I select "add network printer..etc.." and it is listed and added fine, but once it is added, I am told "unable to connect, access denied" on the printer description.

    Here is my samba config file, if theres something wrong with it, maybe someone can let me know. If it is gonna be too much of a problem - or if it is just not possible, I can just stick the printer on a windows box and share from it.

    Thx.. Dean

  2. #2
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642
    ************************** my samba config file***************************

    # 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 (perhaps too
    # many!) 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 commentry 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]

    # workgroup = NT-Domain-Name or Workgroup-Name, eg: LINUX2
    workgroup = WORKGROUP

    # server string is the equivalent of the NT Description field
    server string = File Server

    # This option is important for security. It allows you to restrict
    # connections to machines which are on your local network. The
    # following example restricts access to two C class networks and
    # the "loopback" interface. For more examples of the syntax see
    # the smb.conf man page
    ; hosts allow = 192.168.1. 192.168.2. 127.

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

    # you may wish to override the location of the printcap file
    ; printcap name = /etc/printcap

    # on SystemV system setting printcap name to lpstat should allow
    # you to automatically obtain a printer list from the SystemV spool
    # system
    ; printcap name = lpstat

    # It should not be necessary to specify the print system type unless
    # it is non-standard. Currently supported print systems include:
    # bsd, sysv, plp, lprng, aix, hpux, qnx
    # printing = cups

    # Uncomment this if you want a guest account, you must add this to /etc/passwd
    # otherwise the user "nobody" is used
    # guest account = pcguest

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

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

    # Security mode. Most people will want user level security. See
    # security_level.txt for details. NOTE: To get the behaviour of
    # Samba-1.9.18, you'll need to use "security = share".
    security = share

    # Use password server option only with security = server
    # The argument list may include:
    # password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
    # or to auto-locate the domain controller/s
    # password server = *
    ; password server = <NT-Server-Name>

    # Note: Do NOT use the now deprecated option of "domain controller"
    # This option is no longer implemented.

    # You may wish to use password encryption. Please read
    # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
    # Do not enable this option unless you have read those documents
    ; encrypt passwords = yes

    # Where to find the SSL certificates:
    ssl CA certDir = /etc/ssl/certs

    # 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 = /usr/local/samba/lib/smb.conf.%m

    # Most people will find that this option gives better performance.
    # See speed.txt 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

    # Configure Samba to use multiple interfaces
    # If you have multiple network interfaces then you must list them
    # here. See the man page for details.
    ; interfaces = 192.168.12.2/24 192.168.13.2/24

    # Browser Control Options:
    # set local master to no if you don't want Samba to become a master
    # browser on your network. Otherwise the normal election rules apply
    ; local master = no

    # OS Level determines the precedence of this server in master browser
    # elections. The default value should be reasonable
    ; os level = 33

    # Domain Master specifies Samba to be the Domain Master Browser. This
    # allows Samba to collate browse lists between subnets. Don't use this
    # if you already have a Windows NT domain controller doing this job
    ; domain master = yes

    # Preferred Master causes Samba to force a local browser election on startup
    # and gives it a slightly higher chance of winning the election
    preferred master = yes

    # Enable this if you want Samba to be a domain logon server for
    # Windows95 workstations.
    ; domain logons = yes

    # if you enable domain logons then you may want a per-machine or
    # per user logon script
    # run a specific logon batch file per workstation (machine)
    ; logon script = %m.bat
    # run a specific logon batch file per username
    ; logon script = %U.bat

    # Where to store roving profiles (only for Win95 and WinNT)
    # %L substitutes for this servers netbios name, %U is username
    # You must uncomment the [Profiles] share below
    ; logon path = \\%L\Profiles\%U

    # Windows Internet Name Serving Support Section:
    # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
    # wins support = yes

    # 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

    # WINS Proxy - Tells Samba to answer name resolution queries on
    # behalf of a non WINS capable client, for this to work there must be
    # at least one WINS Server on the network. The default is NO.
    ; wins proxy = yes

    # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
    # via DNS nslookups. The built-in default for versions 1.9.17 is yes,
    # this has been changed in version 1.9.18 to no.
    dns proxy = no

    #============================ Share Definitions ==============================
    [homes]
    comment = Home Directories
    browseable = no
    writable = yes

    # Un-comment the following and create the netlogon directory for Domain Logons
    ; [netlogon]
    ; comment = Network Logon Service
    ; path = /usr/local/samba/lib/netlogon
    ; guest ok = yes
    ; writable = no
    ; share modes = no


    # Un-comment the following to provide a specific roving profile share
    # the default is to use the user's home directory
    ;[Profiles]
    ; path = /usr/local/samba/profiles
    ; browseable = no
    ; guest ok = yes


    # NOTE: If you have a BSD-style print system there is no need to
    # specifically define each individual printer
    #[printers]
    # comment = All Printers
    # path = /var/spool/samba
    # browseable = yes
    # public = yes #to allow user 'guest account' to print
    # guest ok = yes
    # writable = yes
    # printable = yes

    [printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = yes
    create mask = 0700
    guest ok = yes
    #guest only = Yes
    #guest account = smbuser
    public = yes
    printable = Yes
    print command = lpr -P %p -o raw %s -r
    lpq command = lpstat -o %p
    lprm command = cancel %p-%j

    # This one is useful for people to share files
    ;[tmp]
    ; comment = Temporary file space
    ; path = /tmp
    ; read only = no
    ; public = yes

    # A publicly accessible directory, but read only, except for people in
    # the "staff" group
    ;[public]
    ; comment = Public Stuff
    ; path = /home/samba
    ; public = yes
    ; writable = yes
    ; printable = no
    ; write list = @staff

    # Other examples.
    #
    # A private printer, usable only by fred. Spool data will be placed in fred's
    # home directory. Note that fred must have write access to the spool directory,
    # wherever it is.
    ;[fredsprn]
    ; comment = Fred's Printer
    ; valid users = fred
    ; path = /homes/fred
    ; printer = freds_printer
    ; public = no
    ; writable = no
    ; printable = yes

    # A private directory, usable only by fred. Note that fred requires write
    # access to the directory.
    ;[fredsdir]
    ; comment = Fred's Service
    ; path = /usr/somewhere/private
    ; valid users = fred
    ; public = no
    ; writable = yes
    ; printable = no

    # a service which has a different directory for each machine that connects
    # this allows you to tailor configurations to incoming machines. You could
    # also use the %U option to tailor it by user name.
    # The %m gets replaced with the machine name that is connecting.
    ;[pchome]
    ; comment = PC Directories
    ; path = /usr/pc/%m
    ; public = no
    ; writable = yes

    # A publicly accessible directory, read/write to all users. Note that all files
    # created in the directory by users will be owned by the default user, so
    # any user with access can delete any other user's files. Obviously this
    # directory must be writable by the default user. Another user could of course
    # be specified, in which case all files would be owned by that user instead.
    ;[public]
    ; path = /usr/somewhere/else/public
    ; public = yes
    ; only guest = yes
    ; writable = yes
    ; printable = no

    # The following two entries demonstrate how to share a directory so that two
    # users can place files there that will be owned by the specific users. In this
    # setup, the directory should be writable by both users and should have the
    # sticky bit set on it to prevent abuse. Obviously this could be extended to
    # as many users as required.
    ;[myshare]
    ; comment = Mary's and Fred's stuff
    ; path = /usr/somewhere/shared
    ; valid users = mary fred
    ; public = no
    ; writable = yes
    ; printable = no
    ; create mask = 0765
    [ftp]
    comment = FTP dir
    path = /home/ftp
    public = yes
    browseable = yes
    guest ok = yes
    writable = yes

  3. #3
    Join Date
    Feb 2000
    Posts
    234
    AFAIK with XP you require to use encrypted passwords, so uncomment the option and try.
    ; encrypt passwords = yes
    remove the ; to uncomment.
    Still wondering what went wrong...

  4. #4
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642
    Nope....

    And it is still sharing files fine. Like I said, I am not sure what the problem really is since I can share files both ways just fine - even with passwords.

    This is why I was not really sure if you could share printers like this between different OS's. I personally have never seen it happen, so was kinda curious...

    And I also tried the printer on the XP box and tried sharing it from that - the Linux box/cups can't connect to it either.

    No sharing either way

    Bummer....

  5. #5
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642


    Hrmrmmm....

  6. #6
    Join Date
    Oct 2000
    Location
    Lilburn, Ga. USA
    Posts
    920
    I don't know what's wrong, but, I daily have someone printing from a win98 box, over here on a linux LJIII, using samba, and it's all no sweat. At least you can be confident that THAT arrangement will work. BTW, I used SWAT for the samba setup.
    ray@raymondjones.net
    HTTP://www.raymondjones.net

  7. #7
    Join Date
    Mar 2002
    Location
    Pennsylvania, USA
    Posts
    1,713
    It is possible to print from WinXP to a Samba shared cups printer.

    I'm using Red Hat 9 with cups printing. I'm sharing out my printers using Samba 3.0 and I am able to print to them from my WinXP Professional machines. I don't have any XP Home machines to test from.

    I am using a different security model for Samba than you are but since you have file sharing working OK, then at least we know that your printing problems might not be a security issue.

    I do think you are missing some critical lines in your smb.conf file. In my global section I have:

    printcap name = /etc/printcap
    load printers = yes
    printing = cups
    printcap = caps

    Those are the only 4 lines I have in my global section that relate to printing.

    Here's what my [printers] share looks like:

    [printers]
    comment = All Printers
    path = /var/spool/samba
    printing = cups
    printcap = cups
    browseable = yes
    # Set public = yes to allow user 'guest account' to print
    guest ok = yes
    writable = no
    printable = yes

    If Samba was compiled properly with the cups libraries, the print commands in the share section will be ignored. I don't think you need them.

    Another thing, I do is use a Raw print queue to share out the printer in Linux. This allows the printer driver on the Windows machine to do all the work. All the Linux machine does is just send the job to the printer, it doesn't process it.
    If I'm also going to print to the printer from Linux, I create a separate printer using the proper driver and print to it.
    Doing it this way is a little extra work up front but saves a lot of frustration.

    Also, when I look at the status of the printer on my XP machines, it says "Access denied, unable to connect". However, I am able to print to the printer.
    I read somewhere the explanation for this error but I can't find it now and can't remember the explanation for it. It is a bogus error messge though.
    If God hadn't meant for us to use GUI tools, there wouldn't have been a Xerox PARC.

  8. #8
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642
    hrrmm..

    Well, heres the real crazy thing...

    I can print from Linux box to Linux box... And since file sharing works fine, I just don't understand what it is.

    This is the 5th major networking job I have done with Win and Lin boxes together and it never seems to work. SuSE, Mandrake, Slackware, and even Deb (via Knoppix) have never done it.

    I just wiped Slack on the server for SuSE. Whole new system from what I had when I started this thread. Still the same prob. And the YaST config tool even has an option to let me "share printers for Windows machines" - nothing.

    BTW - I have tried it on 3 XP machines on the network now, so it is not the XP box...

    Also, when I go to add the printer in windows, it says the server does not have the proper driver installed and asks me to install the correct one. Something wrong there? I usually get the message even when sharing printers on XP boxes, but at least it works.. Not from linux however....

    *damn*

    There has to be a solution.....

  9. #9
    Join Date
    Mar 2002
    Location
    Pennsylvania, USA
    Posts
    1,713
    Originally posted by deanrantala
    Also, when I go to add the printer in windows, it says the server does not have the proper driver installed and asks me to install the correct one. Something wrong there? I usually get the message even when sharing printers on XP boxes, but at least it works.. Not from linux however....

    *damn*

    There has to be a solution.....
    The error message about the server not having the proper printer driver is normal. By default, the drivers on the Linux machine won't work on a windows machine. I just let XP load whatever driver comes with it for that particular printer.

    You can configure Samba so you can load the Windows printer drivers on it. I've never done it though. If I had hundreds of workstations that would be using the printer I probably would. I've usually only had just a few workstations using the printer so it hasn't been worth the effort.

    I've never had a problem printing from Windows machines to Samba shared Linux printers. However, I've never used security = share. But that should work. According to the Samba documentation I've read, security = share is designed for print servers to keep it simple.

    Have you looked through the log files on your Linux machine and event viewer on the Windows machine for any hints as to why or where it's failing?

    With the problems you are having, I think I'd have to use a Network Analyzer like Ethereal and see where your print jobs are failing. Are the print jobs getting to the Samba server but not being printed or are they never leaving the Windows machine. There has to be an answer.
    If God hadn't meant for us to use GUI tools, there wouldn't have been a Xerox PARC.

  10. #10
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642
    Well, I could try tracing it down.. and I DO have ethereal - although I have never sued it and have no idea what to even do with it.. I just really hope I am not learning to ride a bike for the 20-something'th time....

    An update - I also tried using the raw printer method - same thing. Also - is there a specific port that is used for this? I have no idea what else it could be. Have you ever used anyhiotng else besides RH? Have you always configured by hand?

    On a side note.. I never see the job get sent to the printer qeue on the Linux box. And since I can never see the status of the job from the win box ("access denied, unable to connect") - I have no idea what is ever happening to it on the windows end.

    But this seems to be a common problem - Mandrake, SuSE, and Slackware all have done the same thing. This really bites me too... I am about inches from killing the Linux part for Win Server 2003 about now just to get back functionality it is that bad now. Never tried sharing printers on RH however.

    I am gonna look into it some more tonight.. But I am not sure it will uncover anything. I have gone through these settings on multiple networks using 3 different distros and various windows versions and have yet to see this work. Both configuring it by hand AND wioth the proper GUI tools.

  11. #11
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642
    Something interesting I just noticed on this SuSE box... When I go to set up cups manually from localhost:631, I get to where I can see the printers and jobs waiting (from the Linux box of coarse) but as soon as I select anyhitng that needs rot privilages, it says I do not have the proper privilages to accesss the resources on the server - not even Slackware ever gave me that error...

  12. #12
    Join Date
    Dec 2002
    Location
    UTC + 7
    Posts
    339

  13. #13
    Join Date
    Mar 2002
    Location
    Pennsylvania, USA
    Posts
    1,713
    I have never done it with any distro but Red Hat. I lead a sheltered life and Red Hat is the only distro I've ever used.

    I configure the printers with the GUI Printer Configuration app supplied by Red Hat. I've never used the cups web interface to configure the printers.
    I always edit my Samba smb.conf file by hand. But that shouldn't make any difference. Other than the missning cups printing lines in your smb.conf file, yours looks OK. As long as you added the lines I mentioned in my previous post, Samba should be configured properly.

    How are you printing from Linux to Linux? Are you connecting using the SMB share or are you connecting to the printer through cups? I do not have any network sharing of my printers set up through cups. All my sharing is done through Samba.
    I can see in the Red Hat Printer Configuration utility the option to share the printer via cups but I don't use it.

    Other than the printer status, do you get any error messages pop up when you print from Windows or do the print jobs just seem to go to bit heaven(or perhaps bit hell)?

    How do you install Samba? Do you compile it yourself or do you install it from some sort of binary package? If you compile it yourself, perhaps you are missing some option to allow it to support sharing cups printers.
    I've always installed Samba from the rpm packages supplied by Red Hat or samba.org. Since sharing printers has always worked properly, I assume Samba has been compiled with the necessary options.


    Also - is there a specific port that is used for this? I have no idea what else it could be.
    Printing to a Samba share would use some TCP/UDP ports between 135 and 139 plus also possibly TCP port 445. But those are the same ports used for file sharing. If your firewall is letting the file sharing traffic through, it should let the print jobs through.

    It would be a shame to have to spend the money for Windows licensing just for printer sharing. But I can certainly understand your frustration.
    I think before I did that if my printers would supoort it, I'd by a stand alone print server for under $100, attach my printers to it and use lpd printing. That has always proven to be extremely reliable for me.
    If God hadn't meant for us to use GUI tools, there wouldn't have been a Xerox PARC.

  14. #14
    Join Date
    Jul 2002
    Posts
    9
    Perhaps you could try sharing the printer out with straight CUPS, rather than adding the SAMBA layer on top?

    Windows XP supports IPP, the protocol that CUPS uses, natively, and quite well (Windows 2000, on the other hand.....).

    It's really simple to quite simple to set up, also: A few edits to the /etc/cups/cupsd.conf file to set access permissions and security, and all the server side config is done. (You can tell if it's set up right if, from the system you want to print from, http://<IP of server>:631 shows you the CUPS dialog)

    Once that's done, in the add printer dialog in XP, select "Add local printer", then create a new port, of "Standard TCP/IP" type, and paste in the URL to the printer (http://<IP of server>:631/printers/<Printer name>)

    I can post more details of the changes you need to make to cupsd.conf if you need them, but there are walkthroughs and how-tos available that would cover that, if you want to hunt them down.

    Good luck, hope that helps!

    -Onager

  15. #15
    Join Date
    Mar 2002
    Location
    Pennsylvania, USA
    Posts
    1,713
    Onager,
    I would like to use cups shared printing from XP just to know how to do it. A copy of your cupsd.conf file with the lines you added to support your XP machines highlighted would be much appreciated.

    Deanrantala,
    If you want to see if the copy of Samba you are using has been compiled to support cups printing, execute:

    ldd /usr/sbin/smbd

    Substitute the absolute path to where smbd is located on your machine in the command. In the response, you should see a line something like:

    libcups.so.2 => /usr/lib/libcups.so.2 (0x400ee000)

    If you don't see that line, your copy of Samba hasn't been compiled with cups support.
    If God hadn't meant for us to use GUI tools, there wouldn't have been a Xerox PARC.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •