Table of content

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:

1
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:

1
net sam rights grant admin SePrintOperatorPrivilege

Adding a printer

To add one or all the printers while associating the CUPS driver:

1
2
cupsaddsmb -U admin -H printers -v garfield    # 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

1
rpcclient -U admin printers -c 'deldriver garfield'

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:

1
smbclient -I printers.example.com //printers/queue -c 'print -' < my_file.ps

User account

Lists all the information available for every user

1
pdbedit -L -v -u 

Lists the users id

1
net sam list users

Information

Lists the browseable shares:

1
smbclient -U% -L netbiosname

Lists the resources currently in use and the associated users

1
smbstatus

Lists all the available privileges

1
net rpc rights list

Retrieves the SID

1
2
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:

1
getfacl my_file.txt