17 September 2013

setting group in linux for printer administration

Finally I need to learn this matter when I encounter the problem of giving right to ordinary user to touch the printing system administration, namely lpadmin. So here are important commands:
Shows available groups:
$ groups 

Shows groups where a username belong to:
$ id username 

Adds a user into a certain (secondary) group:
$ usermod -a -G group user 
warning: DO NOT forget the -a option. Putting only -G will delete other previously defined groups of the user, and overridden only with the new one. About the primary group check this link about the problem of primary group in debian.

Here is the complete commands with username latihan:
$ id latihan
uid=1001(latihan) gid=1001(latihan) groups=1001(latihan)

$ sudo usermod -a -G lpadmin latihan
$ id latihan
uid=1001(latihan) gid=1001(latihan) groups=1001(latihan),107(lpadmin)
Now user latihan can run lprm to delete print spools.