[sudo-users] Can change PATH when sudo -g?

sudohow at mail2tor sudohow at mail2tor
Tue Feb 21 01:23:29 MST 2017


I want to change user1's PATH to "/specialPATH/bin" when I execute "sudo
-g group2 <command>".  For this, I added below 2 lines to /etc/sudoers:

  user1 ALL = (:group2) NOPASSED: ALL
  Defaults>%group2 secure_path=/specialPATH/bin

But I couldn't change PATH as below:
$ sudo -g group2 env | grep ^PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

I want to change above output to "PATH=/specialPATH/bin".  The line
"Defaults>%group2 ..." in /etc/sudoers is invalid?  Please your help.

my sudo version is 1.8.10p3 (debian stretch)




More information about the sudo-users mailing list