Re: somewhat OT: sudo question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2010-09-09 at 14:12 -0500, Ranjan Maitra wrote:
On Thu, 9 Sep 2010 13:59:18 -0500 JD <jd1008@xxxxxxxxx> wrote:

> 
> 
> On 09/09/2010 11:41 AM, Ranjan Maitra wrote:
> > Hi,
> >
> > I would like to set up sudo permissions for myself (let us say) such
> > that I do not need password for /usr/sbin/pm-hibernate
> > or /usr/sbin/pm-suspend but need it for everything else. Anyone know
> > off-hand how this can be done by adding lines in the /etc/sudoers file?
> >
> > Many thanks and best wishes,
> > Ranjan
> Append a line like the following to /etc/sudoers
> 
> ranjan      ALL=(ALL)       NOPASSWD: ALL

Sorry, maybe I was not clear. I wanted to have the ability to use sudo
without password for the above two commands, but use sudo with password
(required) for everything else.

Will it be enough to type the two commands with a comma separator after
the NOPASSWD: (and instead of the ALL)? I guess I could try this, but
wanted to be sure.

Ranjan


> 
> -- 
> users mailing list
> users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> 


In aliases section:


Cmnd_Alias HIBERNATE = /usr/sbin/pm-hibernate, /usr/sbin/pm-suspend


in the main part:

rajan ALL=(ALL)    NOPASSWD: HIBERNATE


This should do the trick in the way that you will be able to run any command (ALL) and you will be asked for the password, except for commands that are defined under the HIBERNATE alias.


Fact is that once you entered the password in sudo, it will be remembered for the rest of the session.


HTH,

--


Calin

Key fingerprint = 37B8 0DA5 9B2A 8554 FB2B 4145 5DC1 15DD A3EF E857

=================================================
Do you have lysdexia?
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux