Home > OS >  Qt performed in the shell script need root authority, how to do?
Qt performed in the shell script need root authority, how to do?

Time:09-28

I want to acquire the information of host motherboard, the command sudo dmidecode - t 2, and then execute the script in the qt to get the data, but the script need root authority, unable to perform in the qt?

CodePudding user response:

With root privileges to run the program

CodePudding user response:

You are the command to run the ls, for example,
You can echo "user password" | sudo ls
Or use first echo "root password" | su into the root
Execute the command again
  • Related