Why echo 'password' | sudo -S sudo -s does not work whereas echo 'password' | sudo -S mount -a works?
Robert Heller
heller at deepsoft.com
Mon Feb 8 03:18:50 UTC 2021
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
More information about the ubuntu-users
mailing list