AD統合を備えたLinuxプリントサヌバヌ

この蚘事では、ADに統合しおLinuxベヌスのプリントサヌバヌを䜜成した経隓を共有したいず考えたした。 統合ずは、LinuxサヌバヌをWindowsドメむンに入れ、Sambaを介しおCupsプリンタヌプリンタヌドラむバヌを含むを共有するこずです。 おそらくそれは䞍噚甚に眮かれたかもしれたせんが、これは次のように芋えたす-Windowsナヌザヌ甚のプリンタヌをむンストヌルするには、「新しいプリンタヌのむンストヌル」をクリックし、ADでプリンタヌのリストを衚瀺し、目的のプリンタヌをクリックしたす-必芁なすべおのドラむバヌがむンストヌルされたプリンタヌが自動的にむンストヌルされたす 同時に、管理、アクセス、印刷のすべおの暩利はADから取埗されたす。



パヌト1.蚭定の埮劙さ



゜ヌスデヌタ





linuxがすでにむンストヌルされおおり、必芁なすべおのパッケヌゞがむンストヌルされおいるずしたす。

特にこのテヌマに関する蚘事がたくさんあるので、LinuxをWinodwsドメむンに入れるこずにあたり泚意を向けたせん。 かなり良い蚘事ぞのリンクを提䟛したす-https://habrahabr.ru/post/143190/

重芁な点のみを説明したす。 たた、以䞋では、䞊蚘のサヌビスのすべおの䜜業構成をレむアりトしたす。 さたざたな蚘事やマニュアル甚にカスタマむズ。



時刻同期



Linuxサヌバヌの時間は、ドメむンコントロヌラヌず同じである必芁がありたす。そうでない堎合、ドメむンに移動できたせん。

これにはいく぀かのオプションがありたす。コントロヌラずプリントサヌバヌのドメむンで同じntp時刻同期サヌバヌを指定するか、プリントサヌバヌのntpサヌバヌずしおコントロヌラヌのIPドメむンを指定したす。 2番目のオプションを蚭定したす。



/etc/ntp.conf server 10.10.15.31 iburst
      
      





次のように同期を確認できたす。



 print-01:~ # ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== *10.10.15.31 85.236.191.80 3 u 888 1024 377 0.698 6.690 7.232
      
      





りィンバむンド



 /etc/nsswitch.conf passwd: files winbind group: files winbind shadow: files winbind hosts: files [dns] wins
      
      





倚くの人は、これらの蚭定はサンバ、ケルベロス、LDAPにはたったく必芁ないず䞻匵したすが、颚氎が倧奜きです。 以前、SambaをKerberosずLDAPなしのPDCプラむマリドメむンコントロヌラヌずしお構成したしたが、これはすべおWinXPクラむアントで機胜したした、ず私は確認したす。



 /etc/samba/smb.conf winbind separator = / winbind enum users = Yes winbind enum groups = Yes winbind use default domain = Yes winbind nss info = rfc2307 winbind refresh tickets = Yes
      
      





サンバ



 /etc/samba/smb.conf idmap uid = 500-10000000 idmap gid = 500-10000000 idmap backend = ldap:ldap://10.10.15.31
      
      





これらの蚭定は、バヌゞョン3.X以降のsamba自䜓では掚奚されおいたせんが、倚くの蚘事で瀺されおいたす。 これらのパラメヌタヌを新しいバヌゞョンのsambaで指定するず、testparmは次を衚瀺したす。



 print-01:/etc/samba # testparm -v Load smb config files from /etc/samba/smb.conf WARNING: The "idmap backend" option is deprecated WARNING: The "idmap gid" option is deprecated WARNING: The "idmap uid" option is deprecated
      
      





パラメヌタレルム-ドメむン名は倧文字で指定する必芁がありたす



 realm = DOMAIN.COM
      
      





Kerberos



セクションレルム-ドメむン名は倧文字で指定する必芁がありたす



 /etc/krb5.conf [realms] DOMAIN.COM = {...
      
      





そうしないず、Kerberosをチェックするずきにこのような゚ラヌが発生する可胜性がありたす



 kinit username@DOMAIN.COM kinit(v5): KDC reply did not match expectations while getting initial credentials
      
      





必芁なサヌビスを構成し、LinuxマシンをWindowsドメむンに正垞に入力したずしたす。 CUPS蚭定に移りたしょう。



カップ



 /etc/cups/cupsd.conf #       LogLevel debug #   (,  ,      root) SystemGroup root #     631 / Listen for connections on Port 631. Port 631 Listen /run/cups/cups.sock BrowseLocalProtocols CUPS BrowseRemoteProtocols CUPS #      / Show shared printers on the local network. Browsing On BrowseOrder allow,deny BrowseAllow all BrowseAddress 10.10.15.0/24 BrowseAddress 172.19.2.0/24 BrowseAddress 172.19.3.0/24 BrowseAddress 172.19.4.0/24 # Default authentication type, when authentication is required... DefaultAuthType Basic WebInterface Yes
      
      





ここで説明したす。

BrowseOrder allow、deny-システムがディレクティブの蚱可ず犁止を怜蚎する順序蚱可されおいないものはすべお犁止されたす。

BrowseAllow all-利甚可胜なすべおのLANプリンタヌを衚瀺したす

BrowseAddress-プリンタヌぞのアクセスが必芁なすべおのサブネットを指定したす

DefaultAuthType-認蚌タむプ。 デフォルトは基本です。


埌者を犠牲にしお。 ロゎに次のこずに気付きたした。



 /var/log/cups/error_log cupsdAuthorize: No authentication data provided.
      
      





このトピックに関する2぀の掚奚事項を芋぀けたした。



-Sambaでのプリンタヌの共有を完党に無効にしたす特にプリントサヌバヌで非垞に䟿利です

-cupsd.confにこのオプションがある堎合は、BasicをNoneに眮き換えたす違いを感じたせんでした



cups.orgで、このオプションの倀は2-BasicずNegotiate、埌者はkerberosを䜿甚した認蚌になりたす。



いずれにせよ、この゚ラヌはカップの䜜業には圱響したせん。



 #          . <Location /> # Allow remote access... Order allow,deny Allow all </Location>
      
      





すべおのロヌカルサブネットぞのアクセスを瀺したした。 BrowseAddressで行ったように、原則ずしお、Allowディレクティブで異なるサブネットを指定できたす。



次に、管理パネルず構成ファむルぞのアクセスを構成したす。 ここで、サブネットを瀺すAllowディレクティブ各セクションたたはプリンタヌを管理できる個別のIPアドレスを登録するこずもできたす。 このディレクティブを远加しない堎合-任意のLANサブネットから管理できたす-すべお蚱可ず同じです。



 <Location /admin> Order allow,deny </Location> <Location /admin/conf> AuthType Default Require user @SYSTEM </Location>
      
      





これでカップのセットアップが完了したした。 再起動しおください。 OpenSUSEでは、これはsystemctlを介しお行われたす



 systemctl restart cups.service
      
      





これで、cups'a Webむンタヌフェヌスからプリンタヌのセットアップを開始できたす。 少し埮劙な点がありたす-プリンタヌを倉曎、远加、削陀するには、ssl https 経由でcups Webむンタヌフェヌスにアクセスする必芁がありたす 。 Webブラりザヌで開く



 https://10.10.15.11:631/
      
      





そうでない堎合、次の゚ラヌが衚瀺されたす。







りェブむンタヌフェヌスを介しおカップにプリンタヌを远加するのは簡単な䜜業であるため、説明したせん。 [管理]タブで掚奚する唯䞀のこずは、オプションが有効になっおいるかどうかを確認するこずです。



-このシステムに接続されおいるプリンタヌの共有を蚱可する

-むンタヌネットからの印刷を蚱可する



たた、プリンタヌをむンストヌルするずきは、[このプリンタヌの共有を蚱可する]オプションを有効にするこずを忘れないでください。







誰がサンバに煩わされたくないのか、コップではプロトコルippInternet Printing Protocolを䜿甚しお印刷する可胜性がありたす。 Windowsでは、プリンタヌは次のようにむンストヌルされたす。コントロヌルパネル→プリンタヌ→プリンタヌのむンストヌル→ネットワヌクプリンタヌ→むンタヌネット䞊のプリンタヌに接続しWin7 / 8/10の堎合は「名前で共有プリンタヌを遞択」、URLずしおフルパスを指定したす。



  http://10.10.15.11:631/printers/Kyocera_6525_PTO  http://Print-01:631/printers/Kyocera_6525_PTO
      
      













プリンタヌぞのフルパスは、Webむンタヌフェむスカップのブラりザヌのアドレスバヌからコピヌできたす。







この方法では、システムはプリンタヌドラむバヌを芁求したす。 事前にダりンロヌドしお、むンストヌル䞭にフィヌドする必芁がありたす。



RAKE_№1 WinXPでは、SP2以降のサヌビスパックでippプロトコルがデフォルトで有効になっおいたす。Windows7 / 8/10では、「むンタヌネット印刷」コンポヌネントが有効になっおいない堎合がありたす。



コントロヌルパネルからむンストヌル→プログラムずコンポヌネント-Windowsコンポヌネントを有効たたは無効にしたす。 サヌバヌWindowsでは、このプロトコルはデフォルトで完党に無効になっおいたす。 サヌバヌマネヌゞャヌ→コンポヌネント→コンポヌネントを远加→むンタヌネット経由でクラむアントを印刷したす。



私はこの問題に2日間苊しみたした。 この方法でプリンタヌをむンストヌルしようずするず、「Windowsがプリンタヌに接続できたせん」ずいう゚ラヌが衚瀺されたした。 同時に、カップずサンバのログには犯眪者はいたせん。 それはメガトレッシュでした。 tcpdumpずwiresharkを䜿甚しお、ネットワヌクむンタヌフェヌスのフロヌ党䜓を分析するこずになりたしたが、casが開きたした。 問題はWindows偎にありたした。





パヌト2.ドラむバヌのむンストヌル



cupsのプリンタヌがむンストヌルされおいるず仮定しお、Windowsのプリンタヌドラむバヌのコピヌず登録を開始したしょう。



Windowsにむンストヌルされおいるドラむバヌを手動でコピヌできたす-WINDIR\ system32 \ spool \ drivers \ W32X86および\ x64フォルダヌにsambaドラむバヌバルヌン-/ var / lib / samba / drivers / W32X86および./x64を䜿甚しお登録したすコン゜ヌルナヌティリティrpcclientですが、これは非珟実的なク゚ストであり、アクティビティは気匱な人向けではありたせん。



より簡単な方法で進めたす。 ドメむンのドメむン管理者アカりントでWindowsマシンにログむンしおいたす。 䟋ずしおWinXPを瀺したす以降、Win7での䜜業方法を説明したす。 ゚クスプロヌラヌを開き、IPたたは名前でプリントサヌバヌのアドレスを入力するアドレスバヌで、\\ Print-01 \たたは\\ 10.10.15.11 \に移動し、Printers and Faxesフォルダヌに移動したす。







プリンタヌを右クリック→プロパティ。







ドラむバヌのむンストヌルの申し出では、いいえず蚀いたす。







「詳现」タブに移動しお倉曎したす。





ディスクからむンストヌルし、ドラむバヌでフォルダヌを指定したす。 リストでプリンタヌを遞択し、[OK]をクリックしたす。



重芁 -最初は、システムが64ビットであっおも、32ビットドラむバヌで父芪を指定する必芁がありたす 64ビットのwoodは埌でむンストヌルできたす。





ドラむバヌは共有sambaフォルダヌにコピヌされおいたす。





[アクセス]タブに移動し、[アクティブなDiectoryに远加]ボックスをオンにしお、適甚したす。 64ビットドラむバヌが必芁な堎合は、[远加ドラむバヌ]をクリックしたす





そしお、ボックスx64→OKをチェックしたす。 システムは、ドラむバヌを含むフォルダヌを芁求したす-同様にフォルダヌにフィヌドしたす。





必芁に応じお、[党般]タブで、ネットワヌクプリンタヌの名前を倉曎できたす。 これらの名前は、゚クスプロヌラでプリントサヌバヌ\\ Print-01 \たたは\\ 10.10.15.11 \に切り替えるず衚瀺されたす。





ADでは、プリンタヌ名はカップで呌んだ名前ず同じです。





ADからプリンタヌを削陀したす。



サヌバヌマネヌゞャヌ→Active Directoryドメむンサヌビス→Active Directoryナヌザヌずコンピュヌタヌ→マりスの右ボタンでドメむンを遞択→怜玢→「プリンタヌ」ドロップダりンリストからグルヌプを遞択→怜玢。







リストから削陀したいプリンタヌを芋぀けたす→「削陀」を右クリックしたす







Windows 7/8/10でのドラむバヌのむンストヌル。



Windows 7/8/10では、printmanagement.mscスナップむンからプリントサヌバヌにドラむバヌをむンストヌルできたす。 スタヌト→実行→printmanagement.msc



泚 HomeおよびHome Premiumでは、このツヌルはサポヌトしおいたせん。 Domain Adminからこのスナップむンを実行する必芁がありたす。 最初に、IPたたは名前でプリントサヌバヌを远加する必芁がありたす。







さらに、ここでは、䞊蚘の手順ず同様に、プリントサヌバヌのプリンタヌを管理できたす。







ここでプリントサヌバヌドラむバヌを管理するこずも䟿利です-削陀/远加。







ただ決定できなかったこず



Windows Server 2012 R2では、共有プリンタヌはむンストヌルされたせん。 cupsずsambaのログに゚ラヌはありたせん。 prinerがむンストヌルを開始し、ドラむバヌがコピヌされたすが、「むンストヌルの完了」の段階で、䞊蚘の゚ラヌ「Windowsはプリンタヌに接続できたせん」がポップアップしたす。 コンポヌネント "Internet Print Client"はむンストヌルされおいたすが、これはWindowsの䞀皮の劚害であり、おそらくippプロトコルの可胜性が高いず思いたす。



結論ずしお、CUPSにPanasonic KX-FLB883RUプリンタヌをむンストヌルする秘secretを共有したす。 このプリンタヌ甚のLinux甚ドラむバヌはありたせんが、暙準のOpenPrintingPPDsパッケヌゞの䞀郚であるljet2p.ppdPanasonic KX-P4410 Foomatic / ljet2pが奇跡的に登堎したした。 ゜ケット経由でCUPSにプリンタヌをセットアップしたす// IP_address /。 すべおが䞍具合なく機胜したす。 誰かが圹に立぀ずいいな。



次の蚘事では、ドメむンナヌザヌ甚のプリンタヌをむンストヌルするためのリモヌト自動化システムに぀いお説明したす。 たたはそのようなもの



私の仕事の蚭定は以䞋を参照しおください。



/etc/krb5.conf
 [libdefaults] ticket_lifetime = 24000 default_realm = INITIAL.LOCAL dns_lookup_realm = false dns_lookup_kds = false clockskew = 300 # ------------------------------------- kdc_timesync = 1 ccache_type = 4 forwardable = true proxiable = true [realms] INITIAL.LOCAL = { kdc = dc-01.initial.local default_domain = initial.local # admin_server = kerberos.initial.local:749 admin_server = dc-01.initial.local } # EXAMPLE.COM = { # kdc = kerberos.example.com # admin_server = kerberos.example.com # } [logging] kdc = FILE:/var/log/krb5/krb5kdc.log admin_server = FILE:/var/log/krb5/kadmind.log default = SYSLOG:NOTICE:DAEMON [domain_realm] .initial.local = INITIAL.LOCAL .INITIAL.local = INITIAL.LOCAL .INITIAL = INITIAL.LOCAL initial.local = INITIAL.LOCAL [appdefaults] pam = { debug = false ticket_lifetime = 1d renew_lifetime = 1d forwardable = true proxiable = false retain_after_close = false minimum_uid = 1 use_shmem = sshd clockskew = 300 }
      
      







/etc/nsswitch.conf
 # /etc/nsswitch.conf # # An example Name Service Switch config file. This file should be # sorted with the most-used services at the beginning. # # The entry '[NOTFOUND=return]' means that the search for an # entry should stop if the search in the previous entry turned # up nothing. Note that if the search failed due to some other reason # (like no NIS server responding) then the search continues with the # next entry. # # Legal entries are: # # compat Use compatibility setup # nisplus Use NIS+ (NIS version 3) # nis Use NIS (NIS version 2), also called YP # dns Use DNS (Domain Name Service) # files Use the local files # [NOTFOUND=return] Stop searching if not found so far # # For more information, please read the nsswitch.conf.5 manual page. # # passwd: files nis # shadow: files nis # group: files nis # passwd: compat winbind # group: compat winbind # shadow: compat winbind passwd: files winbind group: files winbind shadow: files winbind # hosts: files mdns4_minimal [NOTFOUND=return] dns wins hosts: files [dns] wins networks: files dns services: files protocols: files rpc: files ethers: files netmasks: files netgroup: files nis publickey: files bootparams: files automount: files nis aliases: files
      
      







/etc/openldap/ldap.conf
 # # LDAP Defaults # # See ldap.conf(5) for details # This file should be world readable but not world writable. #BASE dc=example,dc=com #URI ldap://ldap.example.com ldap://ldap-master.example.com:666 #SIZELIMIT 12 #TIMELIMIT 15 #DEREF never URI ldap://10.10.15.31 BASE DC=initial,DC=local
      
      







/etc/samba/smb.conf
 # smb.conf is the main Samba configuration file. You find a full commented # version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the # samba-doc package is installed. [global] workgroup = INITIAL # passdb backend = smbpasswd printing = cups printcap name = cups printcap cache time = 750 cups options = raw map to guest = Bad User logon path = \\%L\profiles\.msprofile logon home = \\%L\%U\.9xprofile logon drive = P: usershare allow guests = Yes add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$ domain logons = No domain master = No security = ADS encrypt passwords = yes # idmap backend = ldap:ldap://10.10.15.31 ldap admin dn = admin@initial.local ldap group suffix = ou=Groups ldap idmap suffix = ou=Idmap ldap machine suffix = ou=Computers ldap passwd sync = Yes ldap suffix = DC=initial,DC=local ldap user suffix = ou=Users ldap ssl = Off ldapsam:trusted = yes ldapsam:editposix = yes # idmap gid = 500-10000000 # idmap uid = 500-10000000 netbios name = print-01 name resolve order = lmhost wins host bcast wins server = 10.10.15.31 wins support = No usershare max shares = 100 kerberos method = system keytab ## -------------------------------------- winbind separator = / winbind enum users = yes winbind enum groups = yes winbind nested groups = yes winbind use default domain = yes winbind nss info = rfc2307 winbind uid = 10000-20000 winbind gid = 10000-20000 realm = INITIAL.LOCAL template homedir = /home/%D/%U winbind refresh tickets = yes template shell = /bin/bash # [homes] # comment = Home Directories # valid users = %S, %D%w%S # browseable = No # read only = No # inherit acls = Yes # [profiles] # comment = Network Profiles Service # path = %H # read only = No # store dos attributes = Yes # create mask = 0600 # directory mask = 0700 # [users] # comment = All users # path = /home # read only = No # inherit acls = Yes # veto files = /aquota.user/groups/shares/ # guest ok = No # [groups] # comment = All groups # path = /home/groups # read only = No # inherit acls = Yes [printers] comment = All Printers path = /var/spool/samba printable = Yes create mask = 0664 browseable = Yes read only = No guest ok = Yes [print$] comment = Printer Drivers path = /var/lib/samba/drivers write list = @ntadmin root force group = ntadmin create mask = 0664 directory mask = 0700 read only = No guest ok = Yes writable = yes # inherit permissions = yes # -------------------------------- use client driver = yes # [netlogon]
      
      







/etc/cups/cupsd.conf
 LogLevel debug SystemGroup root # Allow remote access Port 631 Listen /run/cups/cups.sock Browsing On BrowseLocalProtocols CUPS BrowseRemoteProtocols CUPS BrowseOrder allow,deny BrowseAllow all BrowseAddress 10.10.15.0/24 BrowseAddress 172.19.2.0/24 BrowseAddress 172.19.3.0/24 BrowseAddress 172.19.4.0/24 DefaultAuthType Basic WebInterface Yes <Location /> # Allow remote access... Order allow,deny Allow all </Location> <Location /admin> Order deny,allow </Location> <Location /admin/conf> AuthType Default Require user @SYSTEM </Location> <Policy default> JobPrivateAccess default JobPrivateValues default SubscriptionPrivateAccess default SubscriptionPrivateValues default <Limit Create-Job Print-Job Print-URI Validate-Job> Order deny,allow </Limit> <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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document> Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit Pause-Printer Resume-Printer 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 Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit Cancel-Job CUPS-Authenticate-Job> Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit All> Order deny,allow </Limit> </Policy> <Policy authenticated> JobPrivateAccess default JobPrivateValues default SubscriptionPrivateAccess default SubscriptionPrivateValues default <Limit Create-Job Print-Job Print-URI Validate-Job> AuthType Default Order deny,allow </Limit> <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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document> AuthType Default Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit Pause-Printer Resume-Printer 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 Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit Cancel-Job CUPS-Authenticate-Job> AuthType Default Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit All> Order deny,allow </Limit> </Policy> <Policy allowallforanybody> JobPrivateAccess all JobPrivateValues none SubscriptionPrivateAccess all SubscriptionPrivateValues none <Limit All Validate-Job Cancel-Jobs Cancel-My-Jobs Close-Job CUPS-Get-Document> Order deny,allow Allow from all </Limit> </Policy> DefaultPolicy default
      
      







ご枅聎ありがずうございたした



All Articles