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 userwarning: 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.