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]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux