determining sudo access

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

 



In /etc/profile.d/local.sh I'd like to modify the PATH env variable to include /sbin /usr/sbin and /usr/local/sbin but only if the user has sudo access.

I can use sudo -l but that prompts for the user password unless the user is configured for NOPASSWD in sudo.

Is there a reasonably convenient way to do this? I suppose I could just always included those directories at the end of the PATH... then if users try a restricted command they'll get "requires root" instead of "command not found".

What do other people do?

Ideally this should work via ssh as well

i.e. from one machine to another I often do something like
ssh -t <machine> sudo sysctl -a

Which fails unless the path is set correctly on the remote machine... otherwise I have to specify the full path for sudo and sysctl.




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