Jump to content

GSTN - Cups documentation: Difference between revisions

From TetraWiki
Praveen (talk | contribs)
No edit summary
Praveen (talk | contribs)
No edit summary
Line 5: Line 5:




<div style="color:#00000a;"></div>


<div style="color:#00000a;"></div>


<div style="color:#00000a;"></div>


<div style="color:#00000a;"></div>


<div style="color:#00000a;"></div>


<div style="color:#00000a;"></div>


<div style="color:#00000a;"></div>


<div style="color:#00000a;"></div>
Samba AD
As is Build for Domain Controller installation
Date : 08.08.2016
Document Version : 1.0
 
 
Table of Contents
1.Setup a Samba Active Directory Domain Controller 4
1.1.Configure yum repository for Packages installation. 4
1.2.Assign the Ipv4 address and restart the network services. 5
1.3.Assign the Ipv6 address and restart the network services. And set hostname. 6
1.4.Edit /etc/hosts file and make below entries. 7
1.5.Restart network service. 8
1.6.Reboot server. 9
1.7.Install Dependencies for samba installation. 9
1.8.Dependencies Installation is completed. 10
2.Samba Installation 11
2.1.Download samba file from https://www.samba.org/ and extract it. 11
2.2.Enter in samba-4.4.4 directory and run configure command. 11
2.3.Run make command. 13
2.4.Run make install command. 14
2.5.Provision a new domain: 14
2.6.Provisioning completed successfully. 15
3.Initialisation 16
3.1.Samba doesn't yet have init scripts included 16
3.2.Set the permissions on samba4 file. 19
3.3.Restart samba 19
3.4.Run "smbclient" 20
3.5.Open /etc/named.conf file. 21
3.6.DNS keytab 22
3.7.Also make below entry in named.conf 22
3.8.Change the owner ship as below and restart named services. 23
3.9.Copy Kerberos 23
 
1. Setup a Samba Active Directory Domain Controller
1.1. Configure yum repository for Packages installation.
Edit /etc/yum.repos.d/local.repo
# vi /etc/yum.repos.d/local.repo
 
 
Make below entries. Save file and exit.
[local]
 
name=local
 
baseurl=file:///mnt
 
gpgcheck=0
 
enabled=1
 
 
 
 
1.2. Assign the Ipv4 address and restart the network services.
# nmcli connection modify eth0 ipv4.addresses 172.18.101.14/24 ipv4.method manual ipv4.gateway 172.18.101.1 connection.autoconnect yes ipv4.dns 172.18.101.14
# systemctl restart network.service
 
 
 
1.3. Assign the Ipv6 address and restart the network services. And set hostname.
# nmcli connection modify eth0 ipv6.addresses 2404:a800:1000:d:7800::e/69 ipv6.method manual ipv6.gateway 2404:a800:1000:d:7800::1 connection.autoconnect yes ipv6.dns 2404:a800:1000:d:7800::e
 
# hostnamectl set-hostname gd9103.gstn.local
 
 
1.4. Edit /etc/hosts file and make below entries.
# vi /etc/hosts
172.18.101.14 gd9103.gstn.local gd9103
 
 
2404:a800:1000:d:7800::e gd9103.gstn.local gd9103
 
 
 
 
1.5. Restart network service.
# systemctl restart network.service
 
 
 
1.6. Reboot server.
# init 6
 
 
1.7. Install Dependencies for samba installation.
 
# yum install perl gcc attr libacl-devel libblkid-devel gnutls-devel readline-devel python-devel gdb pkgconfig krb5-workstation zlib-devel setroubleshoot-server libaio-devel setroubleshoot-plugins policycoreutils-python libsemanage-python perl-ExtUtils-MakeMaker perl-Parse-Yapp perl-Test-Base popt-devel libxml2-devel libattr-devel keyutils-libs-devel cups-devel bind-utils libxslt docbook-style-xsl openldap-devel autoconf python-crypto pam-devel
 
 
1.8. Dependencies Installation is completed.
 
 
 


CUPS (Common Unix Printing System)
2. Samba Installation
2.1. Download samba file from https://www.samba.org/ and extract it.
# tar xvzf samba-4.4.4.tar.gz
 
 
2.2. Enter in samba-4.4.4 directory and run configure command.
 
# cd samba-4.4.4/
# ./configure
 
 
 
Now configure done successfully.


As is Build for CUPS


Date : 27.08.2016


Document Version : 1.0


2.3. Run make command.
# make




Make command finished successfully.






Table of Contents:[[#RefHeading2831893905196|1. SAMBA integrated CUPS ( Print Server )3]]
2.4. Run make install command.
# make install


:[[#RefHeading2832093905196|2. SMB.CONF Configuration.4]]


:[[#RefHeading2832293905196|3. CUPS web-based administration interface4]]
2.5. Provision a new domain:


:[[#RefHeading2832493905196|4. CUPS quotas5]]
# /usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive


:[[#RefHeading2833093905196|5. CUPS Access Control.6]]


== 1. SAMBA integrated CUPS ( Print Server )[[Image:]] ==
2.6. Provisioning completed successfully.


[[Image:image-GSTNCUPS1]]


A print server accepts print jobs from network computers, queues them locally and then sends them to the appropriate printers. As well as having domain and file service capabilities, Samba can also act as a MS Windows compatible print server. While Samba provides the interface to Windows/SMB machines, CUPS or LDP is used by Samba to send print jobs to the devices.


CUPS provides a mechanism that allows print jobs to be sent to printers in a standard fashion. The print-data goes to a scheduler which sends jobs to a filter system that converts the print job into a format the printer will understand. The filter system then passes the data on to a backend—a special filter that sends print data to a device or network connection. The system makes extensive use of PostScript and rasterization of data to convert the data into a format suitable for the destination printer.
3. Initialisation
3.1. Samba doesn't yet have init scripts included
1. we can copy script from below link. https://wiki.samba.org/index.php/Samba4/InitScript
2. create a file /etc/rc.d/init.d/samba4


The CUPS scheduler implements Internet Printing Protocol (IPP) over HTTP/1.1. A helper application (cups-lpd) converts Line Printer Daemon protocol (LPD) requests to IPP. The scheduler also provides a web-based interface for managing print jobs, the configuration of the server, and for documentation about CUPS itself.
# vi /etc/rc.d/init.d/samba4


CUPS can process a variety of data formats on the print server. It converts the print-job data into the final language/format of the printer via a series of filters. It uses MIME types for identifying file formats.
and paste the below content in this file.
________________________________
#! /bin/bash
#
# samba4 Bring up/down samba4 service
#
# chkconfig: - 90 10
# description: Activates/Deactivates all samba4 interfaces configured to \
# start at boot time.
#
### BEGIN INIT INFO
# Provides:
# Should-Start:
# Short-Description: Bring up/down samba4
# Description: Bring up/down samba4
### END INIT INFO
# Source function library.
. /etc/init.d/functions
if [ -f /etc/sysconfig/samba4 ]; then
. /etc/sysconfig/samba4
fi
CWD=$(pwd)
prog="samba4"
start() {
# Attach irda device
echo -n $"Starting $prog: "
/usr/local/samba/sbin/samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then success $"samba4 startup"; else failure $"samba4 startup"; fi
echo
}
stop() {
# Stop service.
echo -n $"Shutting down $prog: "
killall samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then failure $"samba4 shutdown"; else success $"samba4 shutdown"; fi
echo
}
status() {
/usr/local/samba/sbin/samba --show-build
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status irattach
;;
restart|reload)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
______________________________________________________________________________


The backends are the ways in which CUPS sends data to printers. There are several backends available for CUPS: parallel, serial, and USB ports, cups-pdf PDF Virtual Printing, as well as network backends that operate via the IPP, JetDirect (AppSocket), Line Printer Daemon ("LPD"), and SMB protocols.


CUPS integrated with SAMBA supports multiple end user operating systems – e.g. Linux all flavors (Desktop OS and Server OS, Windows 7 and higher, Windows server 2003 and higher, Mac OS.




Line 75: Line 234:




== 2. SMB.CONF Configuration. ==


To integrated CUPS with samba i made below entries in '''smb.conf.'''


<div style="color:#00000a;">[[Image:]]</div>


== 3. CUPS web-based administration interface ==


On all platforms, CUPS has a web-based administration interface that runs on port 631. It particularly helps the need to monitor print jobs and add print queues and printers remotely. This interface is with an enhanced administration interface that allows users to add, modify, delete, configure, and control classes, jobs, and printers. It Supports reports/ monitoring, Auditing and tracking of print queues . It will also do the centralized allocation /DE-allocation of Network printers to the users.
3.2. Set the permissions on samba4 file.
# chmod 755 /etc/rc.d/init.d/samba4
# chmod +x /etc/rc.d/init.d/samba4
# ln -s /etc/rc.d/init.d/samba4 /etc/rc3.d/S80samba4
# chkconfig --add samba4
# chkconfig samba4 on




'''3.1 CUPS Web interface Home page'''
3.3. Restart samba
# service samba4 restart
  or  systemctl start samba4.service


<div style="color:#00000a;">[[Image:]]</div>




3.4. Run "smbclient"
This is done to check if Samba provides the AD DC default shares "netlogon" and "sysvol", that were created in  "smb.conf" during provisioning.


# /usr/local/samba/bin/smbclient -L localhost -U%




3.5. Open /etc/named.conf file.


'''3.2 CUPS Web interface Administration page'''
# vi /etc/named.conf




== [[Image:]] ==
3.6. DNS keytab
This file was automatically created during provisioning/updating. Add the following' tkey-gssapi-keytab' option to the 'options' section of your named.conf, and set other values as shown in screen shot.


== 4. CUPS quotas ==
tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab";


CUPS supports page and size-based '''quotas''' for each printer. The quotas are tracked individually for each user, but a single set of limits applies to all users for a particular printer. CUPS '''logsevery page''' that is printed on a system to the ''page_log'' file. Page logging is only available for drivers that provide page accounting information, typically all PostScript and CUPS raster devices. Raw queues and queues using third-party solutions such as Foomatic generally do not have useful page accounting information available.


Structure at GSTN : The HP Laserjet Pro M202dw printers act as print servers and authenticate against the Samba AD.


<div style="color:#00000a;">[[Image:|top]]</div>
3.7. Also make below entry in named.conf


== 5. CUPS Access Control. ==
include "/usr/local/samba/private/named.conf";


CUPS allows to create a new or modify an existing printer in such a way that there is a user-based access-control in place. Thus we can allow or deny access to a certain printer based on the user name.


3.8. Change the owner ship as below and restart named services.
# chown named.named /var/named/
# chgrp named /usr/local/samba/private/dns.keytab
# chmod g+r /usr/local/samba/private/dns.keytab
# systemctl enable named.service
# systemctl restart named.service
3.9. Copy Kerberos
file /usr/local/samba/private/krb5.conf to /etc/krb5.conf
# cp /etc/krb5.conf /etc/krb5.conf.ori


<div style="color:#00000a;">[[Image:]]</div>
# cp /usr/local/samba/private/krb5.conf /etc/krb5.conf

Revision as of 04:10, 1 February 2019







Samba AD As is Build for Domain Controller installation Date : 08.08.2016 Document Version : 1.0


Table of Contents 1.Setup a Samba Active Directory Domain Controller 4 1.1.Configure yum repository for Packages installation. 4 1.2.Assign the Ipv4 address and restart the network services. 5 1.3.Assign the Ipv6 address and restart the network services. And set hostname. 6 1.4.Edit /etc/hosts file and make below entries. 7 1.5.Restart network service. 8 1.6.Reboot server. 9 1.7.Install Dependencies for samba installation. 9 1.8.Dependencies Installation is completed. 10 2.Samba Installation 11 2.1.Download samba file from https://www.samba.org/ and extract it. 11 2.2.Enter in samba-4.4.4 directory and run configure command. 11 2.3.Run make command. 13 2.4.Run make install command. 14 2.5.Provision a new domain: 14 2.6.Provisioning completed successfully. 15 3.Initialisation 16 3.1.Samba doesn't yet have init scripts included 16 3.2.Set the permissions on samba4 file. 19 3.3.Restart samba 19 3.4.Run "smbclient" 20 3.5.Open /etc/named.conf file. 21 3.6.DNS keytab 22 3.7.Also make below entry in named.conf 22 3.8.Change the owner ship as below and restart named services. 23 3.9.Copy Kerberos 23


1. Setup a Samba Active Directory Domain Controller 1.1. Configure yum repository for Packages installation. Edit /etc/yum.repos.d/local.repo

  1. vi /etc/yum.repos.d/local.repo


Make below entries. Save file and exit. [local]

name=local

baseurl=file:///mnt

gpgcheck=0

enabled=1



1.2. Assign the Ipv4 address and restart the network services.

  1. nmcli connection modify eth0 ipv4.addresses 172.18.101.14/24 ipv4.method manual ipv4.gateway 172.18.101.1 connection.autoconnect yes ipv4.dns 172.18.101.14
  2. systemctl restart network.service


1.3. Assign the Ipv6 address and restart the network services. And set hostname.

  1. nmcli connection modify eth0 ipv6.addresses 2404:a800:1000:d:7800::e/69 ipv6.method manual ipv6.gateway 2404:a800:1000:d:7800::1 connection.autoconnect yes ipv6.dns 2404:a800:1000:d:7800::e
  1. hostnamectl set-hostname gd9103.gstn.local


1.4. Edit /etc/hosts file and make below entries.

  1. vi /etc/hosts

172.18.101.14 gd9103.gstn.local gd9103


2404:a800:1000:d:7800::e gd9103.gstn.local gd9103



1.5. Restart network service.

  1. systemctl restart network.service


1.6. Reboot server.

  1. init 6


1.7. Install Dependencies for samba installation.

  1. yum install perl gcc attr libacl-devel libblkid-devel gnutls-devel readline-devel python-devel gdb pkgconfig krb5-workstation zlib-devel setroubleshoot-server libaio-devel setroubleshoot-plugins policycoreutils-python libsemanage-python perl-ExtUtils-MakeMaker perl-Parse-Yapp perl-Test-Base popt-devel libxml2-devel libattr-devel keyutils-libs-devel cups-devel bind-utils libxslt docbook-style-xsl openldap-devel autoconf python-crypto pam-devel


1.8. Dependencies Installation is completed.



2. Samba Installation 2.1. Download samba file from https://www.samba.org/ and extract it.

  1. tar xvzf samba-4.4.4.tar.gz


2.2. Enter in samba-4.4.4 directory and run configure command.

  1. cd samba-4.4.4/
  2. ./configure


Now configure done successfully.



2.3. Run make command.

# make


Make command finished successfully.


2.4. Run make install command.

  1. make install


2.5. Provision a new domain:

  1. /usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive


2.6. Provisioning completed successfully.


3. Initialisation 3.1. Samba doesn't yet have init scripts included 1. we can copy script from below link. https://wiki.samba.org/index.php/Samba4/InitScript 2. create a file /etc/rc.d/init.d/samba4

  1. vi /etc/rc.d/init.d/samba4

and paste the below content in this file. ________________________________

  1. ! /bin/bash
  2. samba4 Bring up/down samba4 service
  3. chkconfig: - 90 10
  4. description: Activates/Deactivates all samba4 interfaces configured to \
  5. start at boot time.
      1. BEGIN INIT INFO
  6. Provides:
  7. Should-Start:
  8. Short-Description: Bring up/down samba4
  9. Description: Bring up/down samba4
      1. END INIT INFO
  10. Source function library.

. /etc/init.d/functions if [ -f /etc/sysconfig/samba4 ]; then . /etc/sysconfig/samba4 fi CWD=$(pwd) prog="samba4" start() {

  1. Attach irda device

echo -n $"Starting $prog: " /usr/local/samba/sbin/samba sleep 2 if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then success $"samba4 startup"; else failure $"samba4 startup"; fi echo } stop() {

  1. Stop service.

echo -n $"Shutting down $prog: " killall samba sleep 2 if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then failure $"samba4 shutdown"; else success $"samba4 shutdown"; fi echo } status() { /usr/local/samba/sbin/samba --show-build }

  1. See how we were called.

case "$1" in start) start

stop) stop

status) status irattach

restart|reload) stop start

  • )

echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac exit 0 ______________________________________________________________________________












3.2. Set the permissions on samba4 file.

  1. chmod 755 /etc/rc.d/init.d/samba4
  2. chmod +x /etc/rc.d/init.d/samba4
  3. ln -s /etc/rc.d/init.d/samba4 /etc/rc3.d/S80samba4
  4. chkconfig --add samba4
  5. chkconfig samba4 on


3.3. Restart samba

  1. service samba4 restart
 or  systemctl start samba4.service


3.4. Run "smbclient" This is done to check if Samba provides the AD DC default shares "netlogon" and "sysvol", that were created in "smb.conf" during provisioning.

  1. /usr/local/samba/bin/smbclient -L localhost -U%


3.5. Open /etc/named.conf file.

  1. vi /etc/named.conf


3.6. DNS keytab This file was automatically created during provisioning/updating. Add the following' tkey-gssapi-keytab' option to the 'options' section of your named.conf, and set other values as shown in screen shot.

tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab";


3.7. Also make below entry in named.conf

include "/usr/local/samba/private/named.conf";


3.8. Change the owner ship as below and restart named services.

  1. chown named.named /var/named/
  2. chgrp named /usr/local/samba/private/dns.keytab
  3. chmod g+r /usr/local/samba/private/dns.keytab
  4. systemctl enable named.service
  5. systemctl restart named.service

3.9. Copy Kerberos

file /usr/local/samba/private/krb5.conf to /etc/krb5.conf
  1. cp /etc/krb5.conf /etc/krb5.conf.ori
  1. cp /usr/local/samba/private/krb5.conf /etc/krb5.conf