[ale] to sudo or not to sudo

John Pilman jcpilman at gmail.com
Thu Jan 26 14:58:52 EST 2012


On Thu, Jan 26, 2012 at 12:38 PM, Sparr <sparr0 at gmail.com> wrote:
> If your user has permission to sudo sudo then your script can `sudo -u
> non-root-user idle bin/ascript.py` at the end.
>
> On Thu, Jan 26, 2012 at 9:53 AM, John Pilman <jcpilman at gmail.com> wrote:
>> Gentle Folk
>>
>> I have a bash script I often run which requires root access, so I
>> precede the command with sudo.  It looks like this:
>>
>> sudo bin/mount_some_network_folders
>>
>> After that, I usually run a command that does not require root access.
>> It looks like this:
>>
>> idle bin/ascript.py
>>
>> So I thought, why not append that command to the end of my script and
>> save a score of keystrokes.  My question is, can I return back from
>> the sudo while inside the bash script before executing that last line?

Thanks for the help.

Leam, you were right, I just misunderstood at first.
Jeff, your's was the answer I was really looking for.
As for the security of the script, it is a single user machine with an
encrypted drive, so I don't think anyone will tamper with it.
Actually, I'm not sure why I have to use root to mount these samba
shares.  That may be the topic of further investigation.

...John



More information about the Ale mailing list