使用Linux shell运行sudo命令,获取超级权限。 cat sudo.sh echo passwd | sudo -S cat /etc/sudoers 需要将密码写在脚本中,这样就可以自动输入密码了。