我正在 Debian (4.14.108-ti-r113) 上运行 Beaglebone。我需要从 debian 用户运行 root 命令。我尝试了很多方法仍然导致错误。
一些尝试:
$ echo "MYPASSWORD" | sudo -kS ls
[sudo] password for debian: Sorry, try again.
[sudo] password for debian:
sudo: 1 incorrect password attempt
$ sudo -S <<< MYPASSWORD ls
[sudo] password for debian: Sorry, try again.
[sudo] password for debian:
sudo: 1 incorrect password attempt
$ echo -e "MYPASSWORD\n"|sudo -S
[sudo] password for debian: Sorry, try again.
[sudo] password for debian:
sudo: 1 incorrect password attempt
注意:MYPASSWORD 不包含 $,仅包含 a 到 z 字符
任何想法?