Printing
Printer management rights
To allow a user to perform management operations (add, remove, …) on a printer, he must be given the corresponding privileges.
This is done as the root user by using the command:
net -U root -n netbiosname rpc rights grant admin SePrintOperatorPrivilege
However, it is not always possible to identify with Samba as
root, because Samba can be configured to use an LDAP
directory in which the root user is missing.
In this case, changes must be made directly to sam instead of going
through an RPC call:
net sam rights grant admin SePrintOperatorPrivilege
Adding a printer
To add one or all the printers while associating the CUPS driver:
cupsaddsmb -U admin -H printers -v Printer name # Adding the printer: garfield
cupsaddsmb -U admin -H printers -v -a # Adding all the available printers
Be careful to the printer name and its case, a difference in case with the name entered in CUPS will result in installation problems on some versions of Windows.
Deleting a printer
rpcclient -U admin printers -c 'deldriver Printer name'
Printing
It is possible, although a direct access to CUPS is generally preferred, to print from Unix using the Samba client. To do this, run the following command:
smbclient -I printers.example.com //printers/queue -c 'print -' < my_file.ps
User account
Lists all the information available for every user
pdbedit -L -v -u
Lists the users id
net sam list users
Information
Lists the browseable shares:
smbclient -U% -L netbiosname
Lists the resources currently in use and the associated users
smbstatus
Lists all the available privileges
net rpc rights list
Retrieves the SID
net rpc getsid net getlocalsid
Miscellaneous
Shows the file ACLs
This is useful when the zfsacl module is stacked and we want to see
the result of the ACLs created on the Unix file system:
getfacl Filename