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

Re: setting path for root after "sudo su" and "sudo" for Debian Bullseye (11)



On Thu, May 19, 2022 at 06:22:07AM -0500, Tom Browder wrote:
> On Thu, May 19, 2022 at 06:03 Greg Wooledge <greg@wooledge.org> wrote:
> 
> > On Thu, May 19, 2022 at 05:47:29AM -0500, Tom Browder wrote:
> > >     $ sudo su
> > >     # ./myprog install
> >
> > Again, there's no reason to use both "sudo" AND "su".  Just "sudo -s"
> > would give you the interactive root shell, without changing directory.
> >
> > I feel like you're doing "sudo su" out of some bad habit that you've
> > developed.  You'd be doing yourself a favor if you retrain yourself
> > to use "sudo -s" instead.
> 
> 
> Greg, I think I need to change the paths in the sudoer file. I just tried
> the "sudo -i" and sudo -s" incantations on my script and they still don't
> have the needed path component.

Which is... what?

Perhaps what you should be doing instead is creating a symlink named
/usr/local/bin/raku which points to your /opt/whatever/raku program.
That's how third-party (or local) programs that don't install in
/usr/local are typically handled.

> I use the "/etc/sudoers.d" directory with my "username-sudoer" file under
> it. Is that file a place where I could affect the path with some kind of
> bashism?

No idea.  Try it and see?  Also, I'm not sure what you mean by "bashism"
here, but good luck trying to decipher the sudoers(5) man page to see
what's allowed and what isn't.


Reply to: