特殊:Badtitle/NS100:NetwarePrintingFromUbuntu:修订间差异
小 New page: {{From|https://help.ubuntu.com/community/NetwarePrintingFromUbuntu}} {{Languages|php5}} == Introduction == This page covers only how to install a Netware Printer Queue in Ubuntu. == Wh... |
小无编辑摘要 |
||
(未显示2个用户的8个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/NetwarePrintingFromUbuntu}} | {{From|https://help.ubuntu.com/community/NetwarePrintingFromUbuntu}} | ||
{{Languages| | {{Languages|UbuntuHelp:NetwarePrintingFromUbuntu}} | ||
== Introduction == | == Introduction == | ||
This page covers only how to install a Netware Printer Queue in Ubuntu. | This page covers only how to install a Netware Printer Queue in Ubuntu. | ||
== What is Needed == | == What is Needed == | ||
perl - Larry Wall's Practical Extraction and Report Language, needed for ncp script. | perl - Larry Wall's Practical Extraction and Report Language, needed for ncp script. | ||
ipx - utilities to configure the kernel ipx interface. | ipx - utilities to configure the kernel ipx interface. | ||
ncpfs - a set of utilities to use resources from NetWare servers, in particular nprint to print to a netware printer queue. | ncpfs - a set of utilities to use resources from NetWare servers, in particular nprint to print to a netware printer queue. | ||
== Begin the work == | |||
Run Terminal (Applications-> Accessories -> Terminal) | |||
Command> gksu nautilus | |||
Create script file 'ncp' using gedit in /usr/lib/cups/backend directory. | |||
Note that first line of this file should be following: | |||
#! /usr/bin/perl -w | |||
== NCP script == | == NCP script == | ||
Create the script /usr/lib/cups/backend/ncp | |||
Create the script /usr/lib/cups/backend/ncp | <pre><nowiki> | ||
# | |||
#! /usr/bin/perl -w | #! /usr/bin/perl -w | ||
# | # | ||
第153行: | 第150行: | ||
# normal exit | # normal exit | ||
exit 0; | exit 0; | ||
</nowiki></ | </nowiki></pre> | ||
* Don't forget to make the script executable: | |||
sudo chmod +x /usr/lib/cups/backend/ncp | |||
'''Restart CUPS''' | '''Restart CUPS''' | ||
After changing this file, restart CUPS by running ... | |||
<pre><nowiki> | |||
sudo /etc/init.d/ | sudo /etc/init.d/cups restart</nowiki></pre> | ||
* Create a file ".nwclient" in $NCP_HOME directory (generally /root) with following line: | |||
NETWARE_SERVERNAME/NETWARE_USERNAME PASSWORD | |||
== Add a Netware Printer with Gnome menu System | == Add a Netware Printer with Gnome menu System == | ||
1. '''Add a printer definition''', using Printing (Gnome menu '''System -> Administration -> Printing'''). | |||
1. '''Add a printer definition''', using | |||
Select Other printer type. | Select Other printer type. | ||
In the URl: type | In the URl: type | ||
<pre><nowiki> | |||
ncp:// | ncp://NETWARE_SERVERNAME/PRINTER_Q</nowiki></pre> | ||
If at this point you don't see 'Netware Printer via ncp' then refer to 'NCP Script' above. | If at this point you don't see 'Netware Printer via ncp' then refer to 'NCP Script' above. | ||
Select the relevant printer etc. and you should have a working Netware Printer. | |||
Select the | |||
== Add a Netware Printer with Cups Web Interface == | == Add a Netware Printer with Cups Web Interface == | ||
This needs an Administrator account. | This needs an Administrator account. | ||
Please refer to [[UbuntuHelp:NetworkPrintingWithUbuntu|NetworkPrintingWithUbuntu]] -> Ubuntu Client Machine for more info. | |||
Please refer to NetworkPrintingWithUbuntu -> Ubuntu Client Machine for more info. | <pre><nowiki> | ||
# /etc/cups/cupsd.conf | # /etc/cups/cupsd.conf | ||
# Simple CUPS configuration file for a pure client machine: | # Simple CUPS configuration file for a pure client machine: | ||
第307行: | 第297行: | ||
Include /etc/cups/cups.d/ports.conf | Include /etc/cups/cups.d/ports.conf | ||
Include /etc/cups/cups.d/browse.conf | Include /etc/cups/cups.d/browse.conf | ||
</nowiki></ | </nowiki></pre> | ||
To access the Cups Web Interface goto http://localhost:631/ | To access the Cups Web Interface goto http://localhost:631/ | ||
---- | ---- | ||
AccessingNetwareShares CategoryNetworking | [[UbuntuHelp:AccessingNetwareShares|AccessingNetwareShares]] [[category:CategoryNetworking]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月19日 (三) 23:43的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/NetwarePrintingFromUbuntu }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/af | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Afrikaans| [[::NetwarePrintingFromUbuntu/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ar | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|العربية| [[::NetwarePrintingFromUbuntu/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/az | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|azərbaycanca| [[::NetwarePrintingFromUbuntu/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/bcc | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|جهلسری بلوچی| [[::NetwarePrintingFromUbuntu/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/bg | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|български| [[::NetwarePrintingFromUbuntu/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/br | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|brezhoneg| [[::NetwarePrintingFromUbuntu/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ca | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|català| [[::NetwarePrintingFromUbuntu/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/cs | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|čeština| [[::NetwarePrintingFromUbuntu/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/de | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Deutsch| [[::NetwarePrintingFromUbuntu/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/el | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Ελληνικά| [[::NetwarePrintingFromUbuntu/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/es | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|español| [[::NetwarePrintingFromUbuntu/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/fa | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|فارسی| [[::NetwarePrintingFromUbuntu/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/fi | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|suomi| [[::NetwarePrintingFromUbuntu/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/fr | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|français| [[::NetwarePrintingFromUbuntu/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/gu | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|ગુજરાતી| [[::NetwarePrintingFromUbuntu/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/he | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|עברית| [[::NetwarePrintingFromUbuntu/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/hu | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|magyar| [[::NetwarePrintingFromUbuntu/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/id | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Bahasa Indonesia| [[::NetwarePrintingFromUbuntu/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/it | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|italiano| [[::NetwarePrintingFromUbuntu/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ja | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|日本語| [[::NetwarePrintingFromUbuntu/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ko | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|한국어| [[::NetwarePrintingFromUbuntu/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ksh | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Ripoarisch| [[::NetwarePrintingFromUbuntu/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/mr | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|मराठी| [[::NetwarePrintingFromUbuntu/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ms | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Bahasa Melayu| [[::NetwarePrintingFromUbuntu/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/nl | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Nederlands| [[::NetwarePrintingFromUbuntu/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/no | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|norsk| [[::NetwarePrintingFromUbuntu/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/oc | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|occitan| [[::NetwarePrintingFromUbuntu/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/pl | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|polski| [[::NetwarePrintingFromUbuntu/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/pt | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|português| [[::NetwarePrintingFromUbuntu/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ro | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|română| [[::NetwarePrintingFromUbuntu/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/ru | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|русский| [[::NetwarePrintingFromUbuntu/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/si | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|සිංහල| [[::NetwarePrintingFromUbuntu/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/sq | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|shqip| [[::NetwarePrintingFromUbuntu/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/sr | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|српски / srpski| [[::NetwarePrintingFromUbuntu/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/sv | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|svenska| [[::NetwarePrintingFromUbuntu/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/th | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|ไทย| [[::NetwarePrintingFromUbuntu/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/tr | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Türkçe| [[::NetwarePrintingFromUbuntu/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/vi | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|Tiếng Việt| [[::NetwarePrintingFromUbuntu/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/yue | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|粵語| [[::NetwarePrintingFromUbuntu/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/zh | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|中文| [[::NetwarePrintingFromUbuntu/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/zh-hans | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|中文(简体)| [[::NetwarePrintingFromUbuntu/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetwarePrintingFromUbuntu | UbuntuHelp:NetwarePrintingFromUbuntu | {{#if: | :}}NetwarePrintingFromUbuntu}}/zh-hant | • {{#if: UbuntuHelp:NetwarePrintingFromUbuntu|中文(繁體)| [[::NetwarePrintingFromUbuntu/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:NetwarePrintingFromUbuntu|:NetwarePrintingFromUbuntu|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :NetwarePrintingFromUbuntu/zh | | {{#ifexist: NetwarePrintingFromUbuntu/zh | | {{#ifeq: {{#titleparts:NetwarePrintingFromUbuntu|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:NetwarePrintingFromUbuntu|1|-1|}} | zh | | }}
Introduction
This page covers only how to install a Netware Printer Queue in Ubuntu.
What is Needed
perl - Larry Wall's Practical Extraction and Report Language, needed for ncp script. ipx - utilities to configure the kernel ipx interface. ncpfs - a set of utilities to use resources from NetWare servers, in particular nprint to print to a netware printer queue.
Begin the work
Run Terminal (Applications-> Accessories -> Terminal) Command> gksu nautilus Create script file 'ncp' using gedit in /usr/lib/cups/backend directory. Note that first line of this file should be following:
- ! /usr/bin/perl -w
NCP script
Create the script /usr/lib/cups/backend/ncp
# #! /usr/bin/perl -w # # NCP backend for CUPS # # Copyright (C) 2001 Sergey Vlasov <[email protected]> # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # use strict; # Configurable parameters # nprint program name (you may want to put the full pathname here) my $NPRINT = "nprint"; # Home directory (the .nwclient file will be searched there) my $NCP_HOME = "/root"; # End of configurable parameters # No arguments means show available devices if (scalar(@ARGV) == 0) { print "network ncp \"Unknown\" \"NetWare Printer via NCP\"\n"; exit 0; } # Check number of arguments if (scalar(@ARGV) < 5 || scalar(@ARGV) > 6) { print STDERR "ERROR: ncp job user title copies options [filename]\n"; exit 1; } my ($job, $user, $title, $copies, $options, $file) = @ARGV; my $printer = $ENV{"DEVICE_URI"}; # These variables will hold the URI parts my ($server, $queue, $nwuser, $nwpass); # Parse the printer URI into parts for ($printer) { # ncp://USERNAME:PASSWORD@SERVER/QUEUE m|^ncp://(.+):(.*)@(.+)/(.+)| && do { $nwuser = $1; $nwpass = $2; $server = $3; $queue = $4; last; }; # ncp://USERNAME@SERVER/QUEUE m|^ncp://(.+)@(.+)/(.+)| && do { $nwuser = $1; $server = $2; $queue = $3; last; }; # ncp://SERVER/QUEUE m|^ncp://(.+)/(.+)| && do { $server = $1; $queue = $2; last; }; } # Check if the URI was parsed correctly if (not defined $server or not defined $queue) { print STDERR "ERROR: malformed printer URI\n"; exit 1; } # Unquote the URI parts (must be done after splitting) $nwuser =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge if defined $nwuser; $nwpass =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge if defined $nwpass; $server =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge if defined $server; $queue =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge if defined $queue; # Fixed part of the nprint command my @command = ($NPRINT, "-S", $server, "-q", $queue, "-N"); # Add "-U USERNAME" if specified if (defined $nwuser) { push @command, "-U"; push @command, $nwuser; } # Add "-P PASSWORD" if specified if (defined $nwpass) { push @command, "-P"; push @command, $nwpass; } # Append the print file name or "-" to read from stdin if (defined $file) { if ($file =~ /^-/) { # Avoid file names which look like switches $file = "./$file"; } push @command, $file; } else { push @command, "-"; } # nprint will read $HOME/.nwclient, so need to set it $ENV{"HOME"} = $NCP_HOME; # all is ready, run nprint (directly, without using shell) my $result = system { $command[0] } @command; # if not ok, print the error message in the format required by CUPS if ($result != 0) { print STDERR "ERROR: nprint exited with status $result\n"; exit 1; } # normal exit exit 0;
- Don't forget to make the script executable:
sudo chmod +x /usr/lib/cups/backend/ncp Restart CUPS After changing this file, restart CUPS by running ...
sudo /etc/init.d/cups restart
- Create a file ".nwclient" in $NCP_HOME directory (generally /root) with following line:
NETWARE_SERVERNAME/NETWARE_USERNAME PASSWORD
1. Add a printer definition, using Printing (Gnome menu System -> Administration -> Printing).
Select Other printer type. In the URl: type
ncp://NETWARE_SERVERNAME/PRINTER_Q
If at this point you don't see 'Netware Printer via ncp' then refer to 'NCP Script' above. Select the relevant printer etc. and you should have a working Netware Printer.
Add a Netware Printer with Cups Web Interface
This needs an Administrator account. Please refer to NetworkPrintingWithUbuntu -> Ubuntu Client Machine for more info.
# /etc/cups/cupsd.conf # Simple CUPS configuration file for a pure client machine: # which has: # - printers of its own, (and any local printers will be shared?) # - no need for security within the machine, ie a personal workstation # - a network connection to a local network, where it will find CUPS-controlled printer servers # Log general information in error_log - change "info" to "debug" for # troubleshooting... LogLevel warning # Administrator user group... SystemGroup lpadmin # Only listen for connections from the local machine. # These settings are configured in /etc/cups/cups.d/ports.conf so that # changing them does not require to change this file. # Listen localhost:631 # Listen /var/run/cups/cups.sock # This setup also allows access to the "Administrative tasks" system at # http://localhost:631 # File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386) # Server Directives are explained in http://localhost:631/sam.html # 25/04/2006 # [email protected] ConfigFilePerm 0600 LogLevel info Printcap /var/run/cups/printcap RunAsUser Yes #Listen 127.0.0.1:631 #Listen 10.0.0.0/8:631 #Listen 128.0.0.0/16:631 #Listen 192.168.0.0/24:631 Port 631 # Show shared printers on the local network. # The 'Browsing' setting is configured in /etc/cups/cups.d/browse.conf # so that changing it does not require to change this file. # Browsing Off BrowseOrder allow,deny BrowseAllow @LOCAL BrowseAddress @LOCAL # Restrict access to the server... # <Location /> # Order allow,deny # Allow localhost # Allow @LOCAL #</Location> <Location /> AuthType None Order Deny,Allow Deny From All Allow From @LOCAL </Location> <Location /jobs> AuthType None Order Deny,Allow Deny From All Allow From @LOCAL </Location> <Location /printers> AuthType None Order Deny,Allow Deny From All Allow From @LOCAL </Location> # Restrict access to the admin pages... #<Location /admin> # Order allow,deny # Allow localhost # </Location> <Location /admin> AuthType None Order Deny,Allow Deny From All Allow From @LOCAL </Location> # Default authentication type, when authentication is required... DefaultAuthType Basic # Restrict access to configuration files... <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny Allow localhost </Location> # Set the default printer/job policies... <Policy default> # Job-related operations must be done by the owner or an adminstrator... <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job> Require user @OWNER @SYSTEM Order deny,allow </Limit> # All administration operations require an adminstrator to authenticate... <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default> AuthType Basic Require user @SYSTEM Order deny,allow </Limit> # Only the owner or an administrator can cancel or authenticate a job... <Limit Cancel-Job CUPS-Authenticate-Job> Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit All> Order deny,allow </Limit> </Policy> # Include files in /etc/cups/conf.d Include /etc/cups/cups.d/ports.conf Include /etc/cups/cups.d/browse.conf
To access the Cups Web Interface goto http://localhost:631/