1837897 Members
3250 Online
110123 Solutions
New Discussion

Re: Sudo Config

 
SOLVED
Go to solution
Miguel Carabano_1
Regular Advisor

Sudo Config

Hi team,

How do I allow a normal user to cancel any print job with sudo ??

Thanks
11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: Sudo Config

Shalom,

You give them sudo powers of the lp commands for example lpsched

I'm assuming a working knowledge of sudo.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Wallek
Honored Contributor

Re: Sudo Config

To cancel a print job you need access to the 'cancel' command located in /usr/bin.

Miguel Carabano_1
Regular Advisor

Re: Sudo Config

Hi,
How do I can to give permissions to the user ???

/etc/sudoers -> Ideal Config ???

Thanks
Aussan
Respected Contributor
Solution

Re: Sudo Config

lets say you have userA

in sudoers:

userA ALL=NOPASSWD: /usr/bin/cancel



hope it helps
The tongue weighs practically nothing, but so few people can hold it
James R. Ferguson
Acclaimed Contributor

Re: Sudo Config

Hi:

> How do I allow a normal user to cancel any print job

You also have the ability to define a print queue's job's as "cancelable" by any user. See the manpages for 'lpadmin(1M)'.

Regards!

...JRF...
Miguel Carabano_1
Regular Advisor

Re: Sudo Config

Hi,

Fail!!! but...

/etc/sudoers

# User alias specification
User_Alias USERS=user1,user2

# Cmnd alias specification
Cmnd_Alias PRINTING=/usr/bin/cancel

# Defaults specification
Defaults syslog=auth

# User privilege specification
root ALL=(ALL) ALL
user1 ALL=NOPASSWD:/usr/bin/cancel
user2 ALL=NOPASSWD:/usr/bin/cancel

help! please!
Glenn S. Davidson
Trusted Contributor

Re: Sudo Config

You need to connect the aliases. At this point sudo doesn't know user1 or user2 it knows the alias USER. The last line should read:

USERS ALL=NOPASSWD:/usr/bin/cancel

I would never specify a command be run without the user entering a password.

That's just me.
Conformity Destroys a mans initiative and independence. It supresses his powerful inner drive to do his own thing.
Glenn S. Davidson
Trusted Contributor

Re: Sudo Config

You need to connect the aliases. At this point sudo doesn't know user1 or user2 it knows the alias USER. The last line should read:

USERS ALL=NOPASSWD:PRINTING

I would never specify a command be run without the user entering a password.

That's just me.
Conformity Destroys a mans initiative and independence. It supresses his powerful inner drive to do his own thing.
Glenn S. Davidson
Trusted Contributor

Re: Sudo Config

If this posted multiple times I'm sorry. I just kept remembering other stuff and tried to stop it mid submission.

You need to connect the aliases. At this point sudo doesn't know user1 or user2 it knows the alias USERS and the command alias PRINTING. The last line should read:

USERS ALL=NOPASSWD PRINTING

I would never specify a command be run without the user entering a password.

That's just me.
Conformity Destroys a mans initiative and independence. It supresses his powerful inner drive to do his own thing.
Miguel Carabano_1
Regular Advisor

Re: Sudo Config

Thanks team!!!

Thanks Glenn!!!
Miguel Carabano_1
Regular Advisor

Re: Sudo Config

Thanks