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 01:54:16 UTC 2021


Why echo 'password' | sudo -S sudo -s does not work whereas echo
'password' | sudo -S mount -a works?

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.




More information about the ubuntu-users mailing list