[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] to sudo or not to sudo
- Subject: [ale] to sudo or not to sudo
- From: jcpilman at gmail.com (John Pilman)
- Date: Thu, 26 Jan 2012 14:58:52 -0500
- In-reply-to: <CANp3UNCxQKr9iNh-cG1E=0S1LXyhtrdp2XrQgNTis1CjUbnizg@mail.gmail.com>
- References: <CABrv3tT8TGue6FVBMth69gKWXG8EBCu1nr89EmzY-a9tJeSHzA@mail.gmail.com> <CANp3UNCxQKr9iNh-cG1E=0S1LXyhtrdp2XrQgNTis1CjUbnizg@mail.gmail.com>
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