Why echo 'password' | sudo -S sudo -s does not work whereas echo 'password' | sudo -S mount -a works?
孙世龙 sunshilong
sunshilong369 at gmail.com
Mon Feb 8 03:29:14 UTC 2021
>echo 'password' | sudo -S -s
Here are the error messages:
vc at localhost:~$ echo 'abc' | sudo -S -s
/bin/bash: line 1: abc: command not found
vc at localhost:~$ echo 'ccc' | sudo -S -s
/bin/bash: line 1: ccc: command not found
I hope to change the (effective) user as root and then execute
several(maybe, a lot) commands that normal could not handle, e.g:
chown.
On Mon, Feb 8, 2021 at 11:20 AM Robert Heller <heller at deepsoft.com> wrote:
>
> At Mon, 8 Feb 2021 09:54:16 +0800 "Ubuntu user technical support, not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:
>
> >
> > Content-Type: text/plain
> >
> > Why echo 'password' | sudo -S sudo -s does not work whereas echo
> > 'password' | sudo -S mount -a works?
>
> Why are you sudo from sudo?
>
> Did you try
>
> echo 'password' | sudo -S -s
>
> ?
>
> Would that not do what you want?
>
>
>
>
>
> >
> > Here is the error message:
> >
> > vk at localhost:~$ echo 'password' | sudo -S sudo -s
> > /bin/bash: line 1: 1: command not found
> >
> > I know that running a shell as root could be simply achieved by sudo
> > -s(instead of the aforementioned comand).But I really need to invoke
> > the said command indeed.
> >
> > I would be grateful to have some help with this question.
> >
>
> --
> Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
> Deepwoods Software -- Custom Software Services
> http://www.deepsoft.com/ -- Linux Administration Services
> heller at deepsoft.com -- Webhosting Services
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
More information about the ubuntu-users
mailing list