Manuelle Druckerfreigabe auf Samba
In bestimmten Fällen möchten wir nicht, dass alle Drucker unter Windows sichtbar sind, nur bestimmte Drucker.
Wir gehen davon aus, dass wir schon Drucker in CUPS angelegt haben. In der Samba-Standard-Konfiguration werden alle Drucker sichtbar. Deshalb setzen wir die Option load printers = no um zuerst keine Drucker im Netzwerkumgebung zu sehen, danach werden manuell die benötigte Drucker freigegeben.
[global]
workgroup = SCHULE
realm = SCHULE.LAN
netbios name = FS1
server string = Fileserver
security = ADS
encrypt passwords = true
vfs objects = acl_xattr
idmap config * : backend = tdb
idmap config * : range = 1000000-1999999
idmap config SCHULE : backend = rid
idmap config SCHULE : range = 50000 - 99999
winbind nss info = rfc2307
winbind use default domain = Yes
winbind enum users = yes
winbind enum groups = yes
oplocks = no
template shell = /bin/bash
sync always = yes
printing = CUPS
load printers = no
rpc_server:spoolss = external
rpc_daemon:spoolssd = fork
spoolss: architecture = Windows x64
# ...
[printers]
comment = Drucker
path = /tmp
printable = yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
# hier können wir die Druckerfreigaben definieren, die sichtbar in Netzwerkumgebung sein sollten
[Samba_Drucker_name1]
path = /tmp
printable = yes
printer name = Drucker-Name1-in-CUPS
[Samba_Drucker_name2]
path = /tmp
printable = yes
printer name = Drucker-Name2-in-CUPS
workgroup = SCHULE
realm = SCHULE.LAN
netbios name = FS1
server string = Fileserver
security = ADS
encrypt passwords = true
vfs objects = acl_xattr
idmap config * : backend = tdb
idmap config * : range = 1000000-1999999
idmap config SCHULE : backend = rid
idmap config SCHULE : range = 50000 - 99999
winbind nss info = rfc2307
winbind use default domain = Yes
winbind enum users = yes
winbind enum groups = yes
oplocks = no
template shell = /bin/bash
sync always = yes
printing = CUPS
load printers = no
rpc_server:spoolss = external
rpc_daemon:spoolssd = fork
spoolss: architecture = Windows x64
# ...
[printers]
comment = Drucker
path = /tmp
printable = yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
# hier können wir die Druckerfreigaben definieren, die sichtbar in Netzwerkumgebung sein sollten
[Samba_Drucker_name1]
path = /tmp
printable = yes
printer name = Drucker-Name1-in-CUPS
[Samba_Drucker_name2]
path = /tmp
printable = yes
printer name = Drucker-Name2-in-CUPS