Re: Should I redefine PATH in my shell scripts
- From: Maxwell Lol <nospam@xxxxxxxxxxx>
- Date: Thu, 27 Nov 2008 08:22:07 -0500
Francis Moreau <francis.moro@xxxxxxxxx> writes:
Maxwell Lol <nospam@xxxxxxxxxxx> writes:
Francis Moreau <francis.moro@xxxxxxxxx> writes:
Actually I've been hit when trying to run a script through sudo. It
fails because the PATH is changed by sudo and external tools couldn't
be called anymore.
This sounds like a good thing. If you let sudo run any external tool,
you risk the danger of someone being able to break into the root
account.
Fair enough but some of my scripts are intended to be run as root
only.
And if I log to root account by using 'su -' then it works fine. But
if I used "sudo my-script.sh" then it fails.
But if it is run by sudo, then it is invoked by a non-root user. And
if you get an error, then perhaps your script is not secure.
.
- Follow-Ups:
- Re: Should I redefine PATH in my shell scripts
- From: Old Man
- Re: Should I redefine PATH in my shell scripts
- References:
- Should I redefine PATH in my shell scripts
- From: Francis Moreau
- Re: Should I redefine PATH in my shell scripts
- From: houghi
- Re: Should I redefine PATH in my shell scripts
- From: Francis Moreau
- Re: Should I redefine PATH in my shell scripts
- From: Maxwell Lol
- Re: Should I redefine PATH in my shell scripts
- From: Francis Moreau
- Should I redefine PATH in my shell scripts
- Prev by Date: Re: Should I redefine PATH in my shell scripts
- Next by Date: Re: Should I redefine PATH in my shell scripts
- Previous by thread: Re: Should I redefine PATH in my shell scripts
- Next by thread: Re: Should I redefine PATH in my shell scripts
- Index(es):
Relevant Pages
|