Está en la página 1de 16

Basic Samba Network File Sharing Introduction to Samba Server: Samba can be setup to function as different types of network

server. In this article we will cover the basic Samba setup for the Novell Linux Desktop. This document will cover the following areas of the Samba server: 1. Samba Server Types overview 2a. Basic file sharing with MS Windows computers 2b. Samba Server User Accounts & Services 3. Mounting MS Windows File server 4. Troubleshooting 1. Samba Server types: This is a list of the main Samba server role. 1.Domain Controller ADS Domain Controller Primary Domain Controller Backup Domain Controller 2.Domain Servers Active Directory Domain Server NT Domain Servers 3. Stand-alone Server This list can be found at Samba's web site: http://www.samba.org 2a. Basic Samba Stand-Alone File Server: To setup the Samba server you will need to have root privileges. Go in to the Samba directory and edit the smb.conf file. # su # cd /etc/samba # vi smb.conf To setup a basic share in Samba you will need the following entrys. [global] # The workgroup is going to be setup to your internal networks workgroup or domain. workgroup = TUX-NET # Netbios name it going to be the computer name of the Samba server. netbios name = NOVELL # Server string is the equivalent of the NT Description field server string = Linux Samba Server # Samba Security Setting

security = user # You may wish to use password encryption. If you are going to be connecting from a windows 9x computer you will not want to enable this option. Windows 2000 and up, you will want to enable the encrypt passwords. encrypt passwords = yes # Set local master to no if you don't want Samba to become a master browser on your network. You may want to have this turned off by default. local master = no #===== Share Definitions ===== # This part of the smb.conf is where you setup the network share This will let the the home directory get shared. All users home directory on the computer will show up with if this is added. (Note: You will only be able to access you own home directory by default. Other users directory's will not show up in your network browser unless you have setup the permissions to let you access it. most of the time you will want to comment out this entry. [homes] comment = Home Directories browseable = yes writable = yes # Here is a private directory that can only be accessed by tim. (Note: tim will need to have write access to this directory)

[timsdir] comment = Tim's Share path = /usr/somewhere/private valid users = tim public = no writable = yes printable = no 2b. Samba Server User Accounts & Services Now that the smb.conf file has been setup you will need to add the Samba user account. The Samba user account will tie in with your local Linux account. The password to access the Samba can be setup to use the same or different password than your local account. In the example you will see the -a option, this will tell Samba to add the users account to the smbpasswd. # smbpasswd -a tim To change a users Samba password use the same command as above with out the -a option. Now you can start the Samba service. # /etc/init.d/smb start To have the Samba service start on boot, use the chkconfig tool:

# chkconfig sumber : http://www.linuxquestions.org/linux/answers/Networking/Basic_Samba_Network_File_Sharing

Apache + SSL Howto


If you ever do online banking and notice all the URL's start with https:// and have a lockpad symbol on the browser, well thats SSL. In order to tell Apache to include SSL support we need to edit the /etc/apache/httpd.conf file and scroll ALL the way to the bottom. This is where we will uncomment the following line. Code:
change this: #Include /etc/apache/mod_ssl.conf to this: Include /etc/apache/mod_ssl.conf

NOTE: The above assumes that your distribution has shipped with mod_ssl and httpd installed. If you installed from source or your distribution does not contain both of these, this LinuxAnswer will not apply to you. Once that is done you need to make a simple edit to the /etc/rc.d/rc.httpd file so that the apache server knows you want to startup with SSL support. Code:
change this: 'start') /usr/sbin/apachectl start ;; to this: 'start') /usr/sbin/apachectl startssl ;;

Now all thats left is to setup the SSL Certs. If you really don't care about having official certs, Slackware comes with pre-made ones, I use these, but if you ran a legit production webserver you would probably want to spend the money and have real certs made. You also have the option to create your own self-signed certs and if you are interested in that, jump all the way to the bottom of this Howto. Anyway, to use the premade certs run the following commands and say yes to overwrite: Code:
cp /etc/apache/ssl.crt/snakeoil-rsa.crt /etc/apache/ssl.crt/server.crt cp /etc/apache/ssl.key/snakeoil-rsa.key /etc/apache/ssl.key/server.key

Now all thats left to do is restart the apache server: Code:


/etc/rc.d/rc.httpd restart

If you want to make sure that SSL is working correctly run this command: Code:
netstat -tpan | grep 443

If everything is working correctly, you should get output that looks like the following: Code:
tcp 0 27426/httpd 0 0.0.0.0:443 0.0.0.0:* LISTEN

If you don't get any output whatsoever then something went wrong and you need to look at your /var/log/apache/error_log file.

Now that SSL is all set up, you are going to want to tell Apache what to serve up when somebody connects using https://. This is done by the VirtualHost directive and the one pertaining to SSL connections can be found in the /etc/apache/mod_ssl.conf file. The default looks like this and you will certainly need to change some of the settings. Code:
<VirtualHost _default_:443> # General setup for the virtual host DocumentRoot "/var/www/htdocs" ServerName new.host.name ServerAdmin you@your.address ErrorLog /var/log/apache/error_log TransferLog /var/log/apache/access_log

And finally if you want to create your own self-signed certs and not use the ones that come with Slackware thats easy to do as well. I got the following commands from http://www.apachessl.org/#FAQ Code:
Step one - create the key and request: openssl req -new > new.cert.csr Step two - remove the passphrase from the key (optional): openssl rsa -in privkey.pem -out new.cert.key Step three - convert request into signed cert: openssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 1825 Step four - copy the cert and key to the appropriate places cp new.cert.cert /etc/apache/ssl.crt/server.crt cp new.cert.key /etc/apache/ssl.key/server.key

A few things to note: When asked for Common Name in step one, be sure to enter the FQDN of your webserver ie www.mywebserver.com When asked for A challenge password in step one, go ahead and just press enter If you don't remove the passphrase from the key in Step two, you will be prompted to enter a password every time you run /etc/rc.d/rc.httpd start. This means if your box reboots for some reason, your webserver won't start unless you are there to provide the passphrase. Sumber : http://www.linuxquestions.org/linux/answers/Networking/Apache_SSL_Howto

Menambahkan NAS pada Konqueror dan Samba


So I decided to add a DSM G600 to my network to simplify transfering files between the computers in my house. Maybe some other day I will write an essay on installing a DSMG600. Or even better why you should always update firmware in all network devices. For now I will tell you how to access the NAS. First Make sure you have Samba installed. Second It is helpful to install SMBC which is a commandline gui for Samba but it can easily browse your network and find the NAS. Now you have required programs installed. Go into SMBC. Find your network. My DSMG600 used

WORKGROUP. And the unit I named storage. So I got //WORKGROUP/storage/HDD_a and there was my NAS. Using that information, I opened Konqueror. In the address bar I typed "smb://WORKGROUP" This showed me a directory storage. When I clicked on that the address bar changed to "smb://storage" and I went into the HDD_a directory. So this gave me a final address of "smb://storage/HDD_a". Now book mark the directory. Or make a shortcut. This is the quickest way to use your NAS. But I think this might be due to the fact the DSMG600 has linux as its OS and probably running SAMBA. Hope this helps.

Printer Server Setting


Scope and Purpose As the description states, this tutorial deals with setting up a network printer with just linux computers. There is already plenty of information in the forums if you have a windows box. I don't have a windows box, so when I hit a snag I had a tough time finding an answer. Also, I will NOT be specifically describing how to install print drivers on the local machine--there's already plenty of documentation out there on that too, so why waste your time! I will go through the extreme basics of installing and starting the cups server. So, if you're having trouble connecting your linux box to your linux print server, this article is for you! While I am using Slackware 10.1 and KDE, these instructions should be nearly universal for any linux distro (the exception is starting and stopping the cups daemon). Background I have a simple home network set up with two computers and a wireless router. One computer is in my office, while my wife's is in hers. She is connected wirelessly. We both have printers but after a while, paying for two different types of ink cartridges gets to be a hassle. So I decided to turn my box into a print server, so that we could share a printer. NOTE: From here on out, I will call the CUPS server (the computer that has the printer physically plugged into it) server and the networked computer (the computer in the other room) client. Step 1: Make sure your printer works locally Before trying to get a network printer to work, make sure it works locally. While not specific, here's the basics of it (if your printer already works, skip to Step 2): Download and install cups and any other driver software that you need (for example, gimp-print). If you are using swaret, it's as simple as Code:
root# swaret --install cups root# swaret --install gimp-print

Once installed, you need to start the cups daemon (this command will be different if you aren't using Slackware): Code:
root#/etc/rc.d/rc.cups start

This will start the cups server. Next, you'll need to add a printer by using the web interface. To do this, open a web browser and type in localhost:631. If your server is started, a page should load with links to various tasks. Click the first link Do Administration Tasks. A dialog will pop up asking for username and password. You need to log in as root and use your root password to access the administration menu. Once logged in, click add printers and follow the prompts to set up your printer. When the printer is added, click on the "Configure Printer" to set page size and printing quality. Finally, click "Print Test Page". If a test page prints, you're almost ready to go on to Step 2.

You'll want to double check your network setup. It will be easier on everyone involved if your printer server has a static ip instead of dhcp. This can be done using Slackware's netconfig tool (be sure to restart inet1 to put your changes into effect--this is done by typing: /etc/rc.d/rc.inet1 restart). You may also have to adjust your router for a static ip. A quick not regarding static ip's:when you enter the gateway, enter the ip address of your router, or you won't be able to see the wonderfully wide web of the world! Once your printer is setup and your ip is static, go on to Step 2. Step 2: Editing cupsd.conf WARNING: When editing conf files, always make a backup before making changes. That way, when it gets messed up, you have an easy fix! This is done very simply: Code:
root# cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup

Once your backup is created, open the cupsd.conf file using your favorite text editor (vi, nano, emacs, etc.): Code:
root# nano /etc/cups/cupsd.conf

You will me making only small modifications to this file. First and foremost, look for the line that looks something like this: Code:
#ServerName myhost.domain.com

If it isn't there, add it! Note the #. Delete this to uncomment the line. You may either put in your hostname or the static ip address you assigned earlier. The line should look like this: Code:
ServerName 192.168.1.5

Note: For simplicity sake, I personally chose ip address (if you couldn't already tell!). That way if I modify my hostname or anything, the ip can stay the same. The second adjustment you will make is to the line that looks like this(once again if it isn't there, add it): Code:
#BrowseAddress #BrowseAddress #BrowseAddress #BrowseAddress #BrowseAddress #BrowseAddress x.y.z.255 x.y.255.255 x.255.255.255 255.255.255.255 @LOCAL @IF(name)

You can uncomment one of these lines or just add your own. It needs to look like this: Code:
BrowseAddress 192.168.1.255

This should your broadcast for your entire network. Adjust the 255 to whatever your netmask is. Finally look for this section of the cupsd.conf file: Code:
<Location /> Order Deny,Allow Deny From All Allow From 127.0.0.1 </Location>

Create a new line after Allow From 127.0.0.1 and add the ip addresses or ranges for your network. The <Location /> section should look like this when you are done(the new line is in red): Code:
<Location /> Order Deny,Allow Deny From All Allow From 127.0.0.1 Allow From 192.168.1.* </Location>

You should adjust this line according to your network address setup. For example, my network has static ips so I just added the ip address for the client, or networked computer. In networks with many more clients, this is a hassle, so doing the above is more friendly. Save the file and restart the cups server. Code:
root#/etc/rc.d/rc/cups restart

If the server restarts, you are ready to go on to Step 3. If you get an error, make sure that you typed in all of your ip addresses correctly. I ran into trouble when I updated the listen section. It only borked it up, so unless you know what you're doing, only make the changes mentioned above. Step 3: Setting Up the Client Your server is ready to roll, so now it's time to set up your client machine. In order for your client to communicate with the server, the client needs to be running the cups daemon. Install cups and any other driver libraries that you needed on the server. In the above example, it was cups and gimp-print. Start cups: Code:
root#/etc/rc.d.rc.cups start

You need to have cups running to access the network printer. You don't need to do anything with the cupsd.conf though, so once the daemon is started, move on to Step 4. Step 4: Introducing Your Client to Your Server Many tutorials state that you can just add a printer using the KDE control center. I tried it, and I kept getting an error that said "You don't have access." So try to add a printer and if it works, fantastic. If it doesn't or if you don't use kde, read on. On the client, open up your web browser and access localhost:631. Login in using root and root's password. Click on manage printers. If your network printer shows up, you are done and ready to go. If it doesn't, keep going! Click on administration and add printer (de ja vu?). 1. Fill in the name of the printer. 2. Under location, I type in the ip address of the server. 3. You can fill in a description, but you don't have to. 4. Click continue. The next page comes up called Device with a drop down list. Select Internet Printing Protocol (ipp) and click continue. Now you need to tell cups the network location of your print server. To do this, you will need the server's ip address, and the name of your printer as cups sees it. (For example, if you go back to the server and access the web interface, click on printers. The name is big and bold.)This is the format: ipp://server_ip_address/printer/printer_name Change the ip address and printer name accordingly. Your entry should look like:

Code:
ipp://192.168.1.5/printer/EpsonPrinter

Click continue. Choose the correct printer, click continue, choose the correct driver, and click continue again. Be sure to configure the printer so that the driver knows what size paper and print quality to use. Finally, click print test page. Conclusion For some odd reason, once I added a printer on the client, cups could then see my network printer. Now in the cups configuration screen, it shows two printers: the one I added manually and the one is sees on the server. However, in kde and openoffice.org, it only shows one printer. Bizarre, but it works. That's it, your finished. Congratulations and enjoy the network printer! Komentar : by username17 on Mon, 2005-07-25 14:51 Good info... but After installing CUPS, /etc/rc.d/rc.cups is not executable by default. One needs to "chmod +x /etc/rc.d/rc.cups" then execute it. Once it is changed to executable, it will start at boot. If it is not chmodded, you cannot run "/etc/rc.d/rc.cups start" like the tutorial says. Just a FYI. by ylikone on Wed, 2005-09-07 10:53 I have been running an HP Photosmart 8450 as a stand-alone networked printer... and having no problems printing to it with both my windows and Linux computers. As a "for example", here are the approximate steps I took to make it work... ----Go to http://sourceforge.net/project/showf...group_id=16846 and download / install the latest hpijs and hplip. Use the command "hp-makeuri" to get a Device URI. Make sure to specify the IP address of the printer you want to setup. Go to http://www.cups.org/ and download / install the latest cups, if your distro does not already have it setup. Next, go to

http://www.linuxprinting.org/printer_list.cgi?make=HP and download the appropriate .ppd file for your printer and copy it to /usr/share/cups/model. Load up a web browser as root and go to http://127.0.0.1:631/ You should now see the cups web interface. Go to add a new printer... when you get to the Device URI field, enter the string given previously by the "hp-makeuri" command, which should look something like hp:/net/Photosmart_8400_series?ip=192.168.0.20 Print a test page and see if it works. Sumber : http://www.linuxquestions.org/linux/answers/Networking/Setting_Up_a_Network_Printer_using_CUPS

Samba With SSH


ide : utk printer jarak jauh cetak gaji dari pusat ke cabang http://ibiblio.org/gferg/ldp/Samba-with-SSH/Samba-with-SSH-1.html

Setting up Samba over SSH Tunnel miniHOWTO


Mark Williamson, mark_ldp@nunswithguns.co.uk
v0.1, 14 March 2003 How to set up Samba over SSH mini-HOWTO
1. Copyright and License 2. Disclaimer 3. Introduction 4. Setting up an SSH tunnel 5. Creating local directory for smbmount to use 6. Telling smbmount to use your newly created SSH tunnel. 7. Getting an interactive login using smbclient over SSH 8. Scripting file transfer using smbclient over SSH 9. Using Samba over SSH in a shell script

1. Copyright and License


This document, Samba-with-SSH, is copyrighted (c) 2002 by Mark Williamson. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html.

2. Disclaimer
The following document is offered in good faith as comprising only safe programming and procedures. No responsibility is accepted by the author for any loss or damage caused in any way to any person or equipment, as a direct or indirect consequence of following these instructions.

3. Introduction
The most recent version of this document can always be found at http://www.nunswithguns.co.uk/Sambawith-SSH.sgml I began writing this HOWTO because I had to spend far too long figuring it all out myself and I could find no existing HOWTO or tutorial on this subject. I found a few posts to mailing lists from frustrated users but nothing recent and most of the posts I did find were left unanswered. This HOWTO attempts to deal with setting up Samba to use an SSH tunnel. Specifically it deals with setting up a directory on your local linux pc which uses smbmount to connect to a remote windows share where the two computers use an SSH tunnel to 'bounce' through a server in-between them. Also included in this HOWTO are details of how to get an interactive login using smbclient through an SSH tunnel and how to use smbclient in a way suitable for shell scripts. This document leads you through the different steps needed to set up Samba over SSH The environment I have been setting up is like this:
-------------- ((INTERNET)) ---------------| | (local network) (remote network) | | [ linux_1 ] [ linux_2 ] ------------[ windows_server ]

In this example, I want to have a local directory on linux_1 (/mnt/windir) that is a smb mounted folder connected to the windows server. The windows server will ONLY talk to the linux_2 server on the remote network. it will not talk to any machine on the Internet. (We don't trust windows enough for that) . So we have to set up an SSH tunnel from a local port on linux_1 to connect to windows_server through SSH on linux_2.

4. Setting up an SSH tunnel


The first thing to do is to make sure the sshd daemon is installed and running on linux_2 and that linux_1 has SSH installed. Next on linux_1 we need to set up an SSH tunnel from the local port 139 to the windows_server port 139, the SSH tunnel needs to bounce through linux_2 for linux_1 to be able to reach windows_server. You will need to be root to open this SSH tunnel as port 139 is a privileged port. (It is possible to set this up on a different local port if you wish to run SSH from user space and then you must specify the port to use in your smbmount command discussed later in this document.) The command to set up the tunnel using the SSH2 protocol is as follows.

ssh -2 -q -f -N -g -L 139:windows_server:139 username@linux_2 In this example I have used hostnames 'windows_server' and 'linux_2' - these should be replaced with the ip addresses of the machines you wish to connect to. The first '139' corresponds to the port of the local machine, then the destination server and port are specified, and finally the username@linux_2 is the server you wish the ssh tunnel to bounce through. After executing this command you should be prompted for the password for 'username' on server linux_2 .

5. Creating local directory for smbmount to use


The next step is to create a local directory on linux_1 for smbmount to use to mount the remote Windows share. This can be created anywhere you like. My preference is in /mnt but its up to you. mkdir /mnt/remote_share

6. Telling smbmount to use your newly created SSH tunnel.


smbmount is the command that is used to mount a remote Windows share to a local directory. The version of smbmount I am using is Version 2.2.4. Remember to replace linux_1, linux_2 and windows_server with the relevant ip addresses for your setup. smbmount "\\\windows_server_NETBIOS_NAME\destination_folder" /mnt/remote_share/ -o username=WINDOWS_USER,password=WINDOWS_PASSWORD,ip=127.0.0.1 The windows_server_NETBIOS_NAME is the name of the windows computer - usually this would cause smbmount to figure out the ip of that host but as we specify the ip (linux_1's ip or localhost) in the '-o' part of the command this overrides the normal NETBIOS name resolution smbmount would do. The /mnt/remote_share is the directory that you set up on linux_1 in the previous step. the username and password should be the valid username and password that the Windows machine requires to get a login. If all has gone well and you provided a valid username and password, you should now be able to see the contents of the remote windows_servers destination_folder directory in your linux_1 /mnt/remote_share directory. You should also be able to write to the /mnt/remote_share directory and see a file appear in the windows_share/destination_folder directory.

7. Getting an interactive login using smbclient over SSH


Another thing you may want to do is get an interactive ftp-like login to the remote share on windows_server through your SSH tunnel. This can be achieved using the smbclient tool and again telling it the ip address (and port if you chose a port other than 139) to use thus stopping it from resolving the NETBIOS names ip in the usual way it would. The command you would execute to get an ftp style login to the remote share over the SSH tunnel is as follows (remembering to replace the hostnames I use with your relevant ip addresses. smbclient //windows_server_NETBIOS_NAME/destination_folder -U WINDOWS_USER -I 127.0.0.1 You should now get a prompt much like you would for ftp. Typing ls should give you a directory listing.

8. Scripting file transfer using smbclient over SSH


It is also possible to specify the password on the command line when using smbclient by separating it with a

% character from the username in the -U argument - this coupled with the smbclient argument -c can be useful for scripting purposes as the -c argument allows you to pass a command to smbclient to be run after login. - Here are some examples Example 1 - upload foobar.tar.gz from the current directory to the remote windows share over the ssh tunnel. smbclient //windows_server_NETBIOS_NAME/destination_folder -U WINDOWS_USER%WINDOWS_PASSWORD -I 127.0.0.1 -c "put foobar.tar.gz" Example 2 - download some_file.tar.bz2 from the remote share to the current local directory. smbclient //windows_server_NETBIOS_NAME/destination_folder -U WINDOWS_USER%WINDOWS_PASSWORD -I 127.0.0.1 -c "get some_file.tar.bz2" Example 3 - get a directory listing of the destination_folder smbclient //windows_server_NETBIOS_NAME/destination_folder -U WINDOWS_USER%WINDOWS_PASSWORD -I 127.0.0.1 -c "ls"

9. Using Samba over SSH in a shell script


One useful thing that is quite easy to set up is the use of SSH public key authentication to allow your shell scripts to set up the ssh tunnel. This can mean that you can have a tunnel set up from a cron job or just that you won't need to type a password when you run your script manually. Heres how to set up ssh public key authentication for your SSH tunnel to use. On linux_1 server type the following command at a prompt. ssh-keygen -t dsa ssh-keygen will then ask you some questions, You can usually stick to the default answers and as you want your scripts to get a login without a password use an empty passphrase (just push return)
Generating public/private dsa key pair. Enter file in which to save the key (/home/currentUser/.ssh/id_dsa): Created directory '/home/currentUser/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/currentUser/.ssh/id_dsa. Your public key has been saved in /home/currentUser/.ssh/id_dsa.pub. The key fingerprint is: key:fingerprint:displayed:here currentUser@somehost.co.uk

Now you should have a file /home/currentUser/.ssh/id_dsa.pub - this is your public key for this user. you can now upload this file to linux_2 server. Next you should log in to linux_2 and su to the user who you want the ssh tunnel to use - for example sshtunnelusercould be created with their shell set to /bin/false - This would mean that if the user tried to get shell or scp access they would be instantly logged out again while ssh tunnels are able to stay alive without use of a shell. So to add your id_dsa.pub file to the linux_2 sshtunneluser ssh settings, log in as root (or sshtunneluser if you haven't yet set their shell to /bin/false) , go to the directory /home/sshtunneluser/.ssh/ and in there add the file authorized_keys2 . In this file you should insert the text from id_dsa.pub that you uploaded from linux_1. If the .ssh directory doesn't exist already you can either create it

yourself or you can log in as sshtunneluser (set their shell to /bin/bash or something if you need to) and then just use ssh to connect to somewhere - ssh sshtunneluser@linux_2 this will create the default /.ssh directory with the correct permissions for you. Now you should make sure authorized_keys2 is chmod 600 otherwise ssh will ignore it. Next try to ssh to sshtunneluser@linux_2 from linux_1 as user currentUser (or whichever user you ran ssh-keygen as) if all went well, you should see the log in and then either get a prompt if you used /bin/bash as your shell (or other) or you should see it log in and then log out immediately if you set the sshtunneluser to use /bin/false as their shell. If this is working then you can now script the opening of your ssh tunnel to this server - remember you need to add a new line to authorized_key2 file on linux_2 for every user you want to be able to access without needing to have a password - so if you ran your shellscript as any user other than the one you generated an id_dsa.pub file for then you will be asked for a password.

How to add and configure printers through the CUPS web interface?
Author: Robert van den Aker (robert2 AT dds DOT nl) Version: 2006.04.18.0

Introduction
There are two types of printers you can add to your CUPS configuration: raw printers and filtering printers. Raw printers are 'dumb' devices that do nothing more than spit out what they're fed. If I feed my printer a UNIX text file, i.e. one without carriage returns, through a raw queue, it prints the first line of text, sometimes part of the second line of text indented to the end of the first line (no carriage return), and then it gets stuck until I remove the print job and the sheet of paper. If I feed it a PostScript file, it prints one or one and a half lines of PostScript code, etcetera. Your printer may be different. It may print UNIX text files correctly. But then again some printers don't accept text input at all. Or it may be a PS printer and print PostScript correctly. But then you'd have to make a second printer instance to print text to the printer's text queue, if it has one. And that's just ASCII text. Now try printing an image file or a non-ASCII text file to a raw printer queue. It will take a lot of file typing and converting and raster image processing, in other words all the work that a print filter is designed to do. On the whole, raw printers (or printer queues, really) are not very useful if you want to print from the command line or from applications on your SME Server. Other hosts on your network may also be unable to print to raw printer queues. Raw printer queues are mainly useful for Windows computers on the network that have a Windows driver for the printer installed. The driver prepares the print job in a printer-ready format and the raw printer spits it out perfectly. You can also use a raw printer queue if you have another type of network host that can prepare print jobs in printer-ready format and has a way to connect to the raw printer queue. A filtering printer queue is a 'smart' device that uses filters to convert the input it receives to a printer-ready format before sending it on to the printer device. CUPS converts most input to PostScript (some input is

directly converted to the generic raster format), then from PostScript to a generic raster format using a socalled PostScript RIP (Raster Image Processor), and then to a printer-specific raster format using printerspecific raster filters. CUPS has built-in converters for text in several character sets and formats, a large variety of image formats, PDF, and PostScript (to clean up 'dirty' PostScript and insert page count information). A filtering printer can be fed many types of input files from the SME Server's command line. It can also be shared to all kinds of hosts on your network as a pseudo-PostScript printer, which is particularly useful for papd clients (papd is the netatalk print server), because they can only see PostScript printers. ***Important*** Please note that in our configuration you cannot feed output from a raster printer driver to a filtering queue. MS Windows drivers for non-PostScript printers are examples of raster printer drivers. If you have Windows computers on your network and you want to use Windows non-PostScript drivers for your printer, you will need to set up a raw queue for the printer. Also note that you can have as many queues as you like in front of any one physical printer. You can set up a raw queue and a (number of) filtering queue(s) for one and the same physical printer.

Adding a filtering printer queue


1. As discussed above, a filtering printer queue requires a filter to convert the input it receives to the kind of output that the printer understands. A conversion filter is one of the parts that make up a printer driver. A printer driver for CUPS consists of the following parts: a. A so-called PPD that specifies what conversion filter is to be used to produce printer-ready output and sets various options for the conversion filter. On RHEL/CentOS/SME Server systems CUPS PPD's are installed in /usr/share/cups/model/. b. A conversion filter that takes its input from one of the inbuilt CUPS filters and produces printer-ready output. Examples of this type of conversion filter are the inbuilt CUPS rastertohp and rastertoepson filters and the rastertoprinter filter from the Gimp-Print driver collection. On RHEL/CentOS/SME Server systems CUPS conversion filters are installed in /usr/lib/cups/filter/. c. Optionally a specialised CUPS backend that takes its input from the conversion filter and does some special handshaking with the physical printer if so required. Examples of this type of CUPS backend are the canon and epson backends from the Gimp-Print driver collection. On RHEL/CentOS/SME Server systems CUPS backends are installed in /usr/lib/cups/backend/. Most conversion filters will get their input from the inbuilt pstoraster filter, a filter that converts PostScript to a generic raster format. This filter requires a gs binary with the cups device built in. A suitable ghostscript package is provided and is installed with your cups package. If you only want to use the inbuilt CUPS printer drivers, that's all you need. However, most people will want to install additional printer drivers. To install additional drivers for the en locale (to have English-language PPD's installed) do (this assumes you have added the rvandenaker-cups repository to your yum configuration): [root@hostname ~]# yum groupinstall cups-drivers-en Alternatively, substitute "de", "es", or "fr" for "en" to have German, Spanish, or French-language PPD's installed. 2. Access the CUPS web interface through the printers panel in the server-manager. Accessing it this way rather than directly has the advantage that you'll already be logged into the server-manager for "synchronizing the printer lists", which you need to do after adding or deleting printers through the CUPS web interface. Log on to the CUPS web interface as "admin". 3. In the CUPS web interface, choose "Do Administration Tasks", then choose "Add a New Printer".

4. Pick a name for your printer. "Location" and "Description" are optional. Please note that the "Location" entry is meant for descriptive information about the physical location of your printer, like "Printer room" or "Cupboard upstairs" or even "Honolulu" if you do remote printing. Press "Continue". 5. Choose a device. The availability of devices depends on what so-called CUPS "backends" you have installed in /usr/lib/cups/backend/. Most standard devices come pre-installed with CUPS. I use the device "Parallel Port #1", because my printer is attached to the first parallel port. If you have a network printer with its own ethernet card or a dedicated print server device, please refer to this table for an overview of commonly used network interface settings. Press "Continue". 6. Enter device settings. For some devices you'll be asked to enter device settings, such as baud rates for serial ports. If there are default settings, accept them. They will usually work. For network printers, you'll be asked to enter the device URI. If you're unsure which setting to choose from the table, you could try something like: socket://192.168.1.10 substituting your network printer's or print server device's IP address of course. Press "Continue". 7. Choose a printer make. What makes and models you can choose from depends on the so-called CUPS PPD's (PostScript Printer Description files, also used for non-PostScript printers in CUPS) that you have installed in /usr/share/cups/model/. If you installed the drivers package, there should be quite a few models to choose from. If your printer model is not listed, please read the additional howto about adding a special type of PPD's known as Foomatic PPD's to your CUPS installation. I have an HP DeskJet 400, so I would choose "HP" here. Press "Continue". 8. Choose a printer model. For my HP DeskJet 400 I can choose between a generic HP DeskJet Series model as supported by an inbuilt CUPS filter or the HP DeskJet 400 model as supported by Gimp-Print. Press "Continue". 9. The printer should have been created successfully. You can follow the offered link to the printer page and print a test page if you like. 10.You may also want (or need!) to choose "Configure Printer" on the CUPS printer page for your printer to set some options and adjust the driver settings. For example, you will need to change the printer configuration from the default if the driver expects a color cartridge but you only have the black cartridge installed. 11.Now click the "Printers" link in the server-manager's left frame. The printer panel should say that your "Printer lists are out of sync". Click the "Synchronize" button to synchronize your printer lists. You should get a screen that says that the printer lists were successfully synchronized. If you now reload the printers panel by clicking "Printers" in the left frame again, the panel should say that your "Printer lists are in sync". This means that the newly added printer is being shared to your network computers through samba and papd. It's also accessible to IPP (Internet Printing Protocol) clients on

your network.

Adding a raw printer queue


1. Access the CUPS web interface through the printers panel in the server-manager. Accessing it this way rather than directly has the advantage that you'll already be logged into the server-manager for "synchronizing the printer lists", which you need to do after adding or deleting printers through the CUPS web interface. Log on to the CUPS web interface as "admin". 2. In the CUPS web interface, choose "Do Administration Tasks", then choose "Add a New Printer". 3. Pick a name for your printer. "Location" and "Description" are optional. Please note that the "Location" entry is meant for descriptive information about the physical location of your printer, like "Printer room" or "Cupboard upstairs" or even "Honolulu" if you do remote printing. Press "Continue". 4. Choose a device. The availability of devices depends on what so-called CUPS "backends" you have installed in /usr/lib/cups/backend/. Most standard devices come pre-installed with CUPS. I use the device "Parallel Port #1", because my printer is attached to the first parallel port. If you have a network printer with its own ethernet card or a dedicated print server device, please refer to this table for an overview of commonly used network interface settings. Press "Continue". 5. Enter device settings. For some devices you'll be asked to enter device settings, such as baud rates for serial ports. If there are default settings, accept them. They will usually work. For network printers, you'll be asked to enter the device URI. If you're unsure which setting to choose from the table, you could try something like: socket://192.168.1.10 substituting your network printer's or print server device's IP address of course. Press "Continue". 6. Choose Model/Driver Make "Raw". Press "Continue". 7. Accept Model/Driver Model "Raw Queue (en)". Press "Continue". 8. The printer should have been created successfully. You can follow the offered link to the printer page if you like. Please note that printing a test page will fail on non-PostScript printers. This is because you're sending a PostScript test page to the printer raw. 9. Now click the "Printers" link in the server-manager's left frame. The printer panel should say that your "Printer lists are out of sync". Click the "Synchronize" button to synchronize your printer lists. You should get a screen that says that the printer lists were successfully synchronized. If you now reload the printers panel by clicking "Printers" in the left frame again, the panel should say that your "Printer lists are in sync". This means that the newly added printer is being shared to your network computers through samba and papd. It's also accessible to IPP (Internet Printing Protocol) clients on your network. http://distro.ibiblio.org/smeserver/contribs/rvandenaker/testing/smeservercups/documentation/howtos/cups-add-printer.html

También podría gustarte