DevTech101

DevTech101

Install all require cups packages

Install cups bindery’s

pkg install \
print/cups \
print/cups/filter/foomatic-db \
print/cups/filter/foomatic-db-engine \
print/cups/hal-cups-utils \
print/cups/system-config-printer \
print/filter/a2ps \
print/filter/ghostscript \
print/filter/ghostscript/fonts/gnu-gs-fonts-other \
print/filter/ghostscript/fonts/gnu-gs-fonts-std \
print/filter/gutenprint \
print/filter/hplip \
print/lp/filter/foomatic-ppds \
print/lp/filter/foomatic-rip \
print/mp \
print/psutils 

Enable cups daemons

svcadm enable /application/cups/in-lpd /application/cups/scheduler

Accessing the cups web GUI

https://print1.domain.com:631
https://print2.domain.com:631

To add/create printers from the commend line, or to create printers on multiple print servers, you can use this perl script

Replace the lines @print_server_list with your print server names.

# Only remote hosts 
my @print_server_list = ('print1', 'print2');

# To configure LDAP, modify the lines with ldapserverone and ldapservertwo.
        $ldapserverone = "ldap1.doamin.com"; 
        $ldapservertwo = "ldap2.doamin.com";
# The domain base will also need to be modified

# The script uses SSH to run on the remote systems, You can change the below lines to your SSH key, or add your SSH password
         @KEYFILE = ("/root/.ssh/id_rsa");
         my $ssh = Net::SSH::Perl->new($print_server, identity_files=>\@KEYFILE);
         $ssh->login(root, $password);
         #my $ssh = Net::SSH::Perl->new($print_server);
        # $ssh->login(root, $password);

Configure cupsd.conf

#
# "$Id: cupsd.conf.in 9310 2010-09-21 22:34:57Z mike $"
#
# Sample configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn

# Administrator user group...
SystemGroup sys root

# Only listen for connections from the local machine.
Listen 631
Listen /var/run/cups-socket

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseProtocols CUPS
BrowseLocalProtocols CUPS
BrowseRemoteProtocols CUPS
BrowseShortNames Yes
ImplicitClasses On

# Default authentication type, when authentication is required...
DefaultAuthType Basic

#
AutoPurgeJobs No
PreserveJobFiles Yes
PreserveJobHistory Yes

# Restrict access to the server...

  Order allow,deny
  Allow all


# Restrict access to the admin pages...

  Order allow,deny
  Allow 10.10.10.0/24


# Restrict access to configuration files...

  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow 10.10.10.0/24


# Set the default printer/job policies...

  # Job-related operations must be done by the owner or an administrator...
  
    Order deny,allow
  

  
    Require user @OWNER @SYSTEM
    Order deny,allow
  

  # All administration operations require an administrator to authenticate...
  
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  

  # All printer operations require a printer operator to authenticate...
  
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  

  # Only the owner or an administrator can cancel or authenticate a job...
  
    Require user @OWNER @SYSTEM
    Order deny,allow
  

  
    Order deny,allow
  


# Set the authenticated printer/job policies...

  # Job-related operations must be done by the owner or an administrator...
  
    AuthType Default
    Order deny,allow
  

  
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  

  # All administration operations require an administrator to authenticate...
  
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  

  # All printer operations require a printer operator to authenticate...
  
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  

  # Only the owner or an administrator can cancel or authenticate a job...
  
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  

  
    Order deny,allow
    Allow all
  


#
# End of "$Id: cupsd.conf.in 9310 2010-09-21 22:34:57Z mike $".
#
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
%d bloggers like this: