I am trying to use samba together with CUPS to share printers and their drivers for Windows machines in the network. Every time I try to upload Printer drivers from a Windows 10 machine via the printmanagement.msc I get an "Access Denied" error, but on the server side I can see, that the files have been created!
I have so far installed samba on an Ubuntu 18.04 LTS workstation, created a samba user "root" with a corresponding password and edited the smb.conf
[print$]
path = /srv/samba/printer_drivers/
read only = no
guest ok = yes
browseable = yes
wirteable = yes
directory mask = 0775
create mask = 0775
write list = @lpadmin, root
admin users = @lpadmin, root
force user = root
the shared directory /srv/samba/printer_drivers/ has the following permissions:
root$ ls -la /srv/samba/printer_drivers/
total 36
drwxrwsr-x 9 root root 4096 Nov 7 14:30 ./
drwxr-xr-x 3 root root 4096 Nov 5 10:24 ../
drwxrwsr-x 2 root root 4096 Nov 7 14:30 IA64/
drwxrwsr-x 2 root root 4096 Nov 7 14:30 W32ALPHA/
drwxrwsr-x 2 root root 4096 Nov 7 14:30 W32MIPS/
drwxrwsr-x 2 root root 4096 Nov 7 14:30 W32PPC/
drwxrwsr-x 2 root root 4096 Nov 7 14:30 W32X86/
drwxrwsr-x 2 root root 4096 Nov 7 14:30 WIN40/
drwxrwsr-x 4 root root 4096 Nov 8 10:41 x64/
The subdirectories were automatically created by the Windows AddDriver Wizard
I connect the share on the Windows host via
net use x: \\hostname\print$ /user:root
I then enter the password which is accepted
the command completed successfully
I can then navigate to the share in windows explorer and create, modify and delete files without any problems. When I open up printmanagement.msc, click on my samba server (which I added as printserver) and select "Add Driver" I am able to select a driver from the list, and click "Finish". I can then see an explorer file-transfer window that shows the files are being copied, and an ls of the shared directory on the Linux machine shows the files are there, but the windows machine then Throws an error:
"A driver HP LaserJet (...), Type 4 - Usermode x64 could not be installed. Access is denied."
As soon as I accept the error message with the OK button the driver files on the share are deleted.
The output of smbstatus (first 3 ip-address parts generalized by me):
root$ smbstatus
Samba version 4.7.6-Ubuntu
PID Username Group Machine Protocol Version Encryption Signing
----------------------------------------------------------------------------------------------------------------------------------------
13162 root root *.*.*.119 (ipv4:*.*.*.119:49176) SMB3_11 - partial(AES-128-CMAC)
Service pid Machine Connected at Encryption Signing
---------------------------------------------------------------------------------------------
print$ 13162 *.*.*.119 Thu Nov 8 12:45:30 PM 2018 CET - -
IPC$ 13162 *.*.*.119 Thu Nov 8 12:45:37 PM 2018 CET - -
Locked files:
Pid Uid DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
13162 0 DENY_NONE 0x80 RDONLY NONE /srv/samba/printer_drivers . Thu Nov 8 12:45:31 2018