Download - Configuring a SAMBA Print Server

Transcript
  • 7/28/2019 Configuring a SAMBA Print Server

    1/8

    Configuring a SAMBA Print Server

    http://beginlinux.com/desktop/opensuse/configuring-a-samba-print-serverhttp://beginlinux.com/desktop/opensuse/configuring-a-samba-print-server
  • 7/28/2019 Configuring a SAMBA Print Server

    2/8

    Desktop - OpenSUSE

    You may be using Linux at home or in an office environment, but often we still need to provide access to Windowdesktops. Begin Linux has taken you though setting up a SAMBA Domain Controller and File Server onopenSUSE 11.4. In this tutorial, again using openSUSE 11.4 we will take the time to look at adding in Print Servcapabilities. Providing Windows Users have transparent access to printing. The assumption is made that SAMBAalready installed and running on your Linux Server.

    We will setup a CUPS (Linux printing) but no great detail of Linux printing is entered into as we are concentratinon SAMBA printing.

    For the purpose of this tutorial is not important that your machine is a Domain Controller, although ours will be.

    1. Overview of CUPS printing and creation of a Linux Printer

    2. Reviewing our Share Definitions to ensure the Linux Printer shares to Windows

    3. Windows Printer Drivers and the Print$ share

    Overview of CUPS printing and creation of a Linux Printer

    CUPS, or the Common UNIX Print System, is prevalent in most Linux distributions these days and has been formany years. If we share printers to our network with CUPS then we can print using IPP (Internet Printing Protocofrom our client. As such we should see TCP port 631 open for this purpose if we choose to look with tools such anetstat.

    Setting up a CUPS printer could not be easier with openSUSE and YaST especially if, as many homes and

    businesses do, you have an HP printer model. You can see from the YaST Add Printer Wizard below that there isRun hp-setup tool in the bottom right. This will detect and configure your HP Printer for CUPS printing.

    http://beginlinux.com/desktophttp://beginlinux.com/desktop/opensusehttp://beginlinux.com/desktop/opensuse/1578-adding-standard-windows-domain-groupshttp://beginlinux.com/desktop/opensuse/configuring-a-samba-print-server#cupshttp://beginlinux.com/desktop/opensuse/configuring-a-samba-print-server#sharedefinitionshttp://beginlinux.com/desktop/opensuse/configuring-a-samba-print-server#printdrivershttp://beginlinux.com/desktophttp://beginlinux.com/desktop/opensusehttp://beginlinux.com/desktop/opensuse/1578-adding-standard-windows-domain-groupshttp://beginlinux.com/desktop/opensuse/configuring-a-samba-print-server#cupshttp://beginlinux.com/desktop/opensuse/configuring-a-samba-print-server#sharedefinitionshttp://beginlinux.com/desktop/opensuse/configuring-a-samba-print-server#printdrivers
  • 7/28/2019 Configuring a SAMBA Print Server

    3/8

    The wizard will start and in this example we select that the printer is on the Network via the Discovery Window.The printer is directly connected to the network.

    The printer is then up and running and available to the Linux Desktop / Server. We can choose to share it via CUP

  • 7/28/2019 Configuring a SAMBA Print Server

    4/8

    to our network and print to it from Windows using IPP, this is not the best method as the print driver is notshared, only the printer.

    If we share the print driver as well as the printer, users do not need to configure printing and require noadditional rights to their machines. For this we require a SAMBA Print Server.

    This HP printer will only be shared via SAMBA so we do not need to configure Printer Sharing in YaST. TheSAMBA Server prints locally to the CUPS printer so it does not need to be shared by CUPS.

    With the wizard complete we now need to look at making this printer and the print driver available to our WindowUsers though SAMBA.

    Reviewing our Share Definitions to ensure the Linux Printer shares to

    Windows

    The nice feeling that I always have at this point, is in the knowing that the SAMBA defaults to share all printersWe should check this to ensure that we have not missed anything and to complete our understanding of the contenof the /etc/samba/smb.conffile.

    From the extract above we can see:

    1. [printers] share: sharing all our Linux Printers. We can control access to the printers via Access Control

    List on the printer once configured.2. [print$] share: Always present on a Windows Print Server and hosts the print drivers for the clients. The

    location of this share is shown and we should see the path /var/lib/samba/drivers . You can change thelocation but there is no real advantage in doing so.

    The path shown does exit but only holds a top level structure to represent hardware platforms. It does not containany drivers. We have to add the Windows drivers to match the OS and Platform of our clients. So if we use 32 bitversions of Windows XP we must add the required drivers for all our printers into the directory:/var/lib/samba/drivers/W32X86. Drivers are easily added using the correct Windows OS and logged in as root. Thgraphic shows the directory structure (and the empty W32X86 directory) of the print$ share.

  • 7/28/2019 Configuring a SAMBA Print Server

    5/8

    Windows Printer Drivers and the Print$ share

    We will now move away from Linux to manage the print share from a Windows XP client, assuming we wish toadd XP drivers. In this way we can add Windows drivers for the shared printer to the print$ share on the server.

    We are working in a SAMBA Domain environment which we have already set-up with Begin Linux tutorials.Having created our Domain Administrators group, to ensure correct permissions, we are able to manage printers athe root user. The root user has also been SAMBA enabled. The XP workstation has been added to theBEGINLINUX domain in the normal manner using the System Control Panel. From the graphic below we will loin as root to the XP Workstation having joined the domain and restarted Windows.

    In the setup of the SAMBA domain we have already made sure that root and other administrators have correctrights to manage Domain Machines by nominating a Linux Group to be Windows Domain Administrators.

    net groupmap add ntgroup=Domain Admins unixgroup=domadmin rid=512 type=d

    We can verify that this is set correctly and effective on the XP Workstation by checking the membership of the

    local administrators group, it should have BeginLinux\Domain Admins in its membership list.

  • 7/28/2019 Configuring a SAMBA Print Server

    6/8

    So now we are in the Domain, (if it is a workgroup then just log on to XP locally and when we connect to the PrinServer adding the root username and password then), you will need to connect to the Print Server using its name

    IP Address. In the example the IP Address of the Server is used. From the start menu on Windows XP choose runand in the dialogue box type \\192.168.0.110 or at least the IP Address or Server Name or your Print Server.

    If all is working then we should be displayed a list of shares including the printer share. We do not connect to thprinter share but rather to Printers and Faxes. This will allow us to manage the Samba Printer instead of justconnecting to the printer (HP) in the graphic following.

  • 7/28/2019 Configuring a SAMBA Print Server

    7/8

    From within Printers and Faxes right-click on the HP printer and choose Properties. A dialogue will warnyou that you have not added a driver yet. Select to Add a Driver Now and from the Windows selection boxchoose your printer model, or Have Disk if you need to load a driver that is not available to Windows.

    NOTE:Now this is the strange bit, it does not add the driver at this stage. Choose the Advanced Tab and selecNew Driver. This will add the print driver to the share. I always select an incorrect driver from the first selectionthen with New Driver I add the correct driver, but we have to do this extra step even though it does not seem tomake a lot of sense.

    If you look at the driver being copied, once the wizard is complete, you will see that this time the driver is copiedthe print$ share and the correct subdirectory. See below:

    Finally lets look at the share to see what we have added: from the run command, again,select \\192.168.110\print$, (adjusting to your server details). You should see a result similar to this is in theW32X86 directory. Look carefully at the address bar to gauge how it will appear on your system.

  • 7/28/2019 Configuring a SAMBA Print Server

    8/8

    From this point forward users just need to double-click on the HP printer share to add the driver to their ownsystem without any elevated rights. The driver from the Print Server loads in RAM on the client. For each sharedCUPS printer you will need to repeat this procedure. For the home or small office though one or two printers isabout what you would expect. But there you have it, you have now set up printing via SAMBA on openSUSE 11.

    If you enjoyed this openSUSE tutorial by Andrew Mallett, please visit the openSUSE tutorial section for acomplete list.

    http://beginlinux.com/desktop/opensusehttp://beginlinux.com/desktop/opensuse