[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Regarding sudo
From: |
Bipul kumar |
Subject: |
Re: [Help-bash] Regarding sudo |
Date: |
Wed, 22 Jun 2016 18:23:36 +0200 |
Hi Gerg,
Thank you for making me correct.
Between still i need for clarification about this statement "*Use it for
the*
*part(s) of the script that require different privileges, and don't use it**for
the parts that should run with the caller's privileges*."
I tried with sudo -u $USER , but my script opens a new console with $USER
account.
On Wed, Jun 22, 2016 at 4:43 PM, Greg Wooledge <address@hidden> wrote:
> On Wed, Jun 22, 2016 at 03:55:40PM +0200, Bipul kumar wrote:
> > I have bash script which runs in sudo user mode. But i would like to make
> > my script to get into normal mode and then perform the task.
> > is there anyway to do? your all support and suggestions will be greatly
> > appreciated.
>
> sudo is not a "mode". It's a command.
>
> I'm assuming you mean that you are typing a command like this one to
> run your script:
>
> sudo myscript
>
> This means your script is executed after sudo has switched to a different
> user ID.
>
> If you only want PART of your script to run with a different user ID, then
> you need to place the sudo command inside the script. Use it for the
> part(s) of the script that require different privileges, and don't use it
> for the parts that should run with the caller's privileges.
>