Problem in launching a terminal command with a Qt Button
hello everybody,
I've created a QT interface with some buttons and labels, and i want to launch a terminal command with one of these buttons,but the command maust starts with "sudo",unfortunately it didn't work because it wants root password and i can't enter it even in the Button cammand.... plz help mz thnx |
Did you try asking this question on their mailing list ?
http://lists.trolltech.com/mailman/listinfo/qt-interest |
You could use one of the gui frontends to sudo. Unfortunately the only ones I know of are:
- gksudo - maybe not good for you since you are using qt, not gtk - kdesudo - qt, but maybe not good for you since it depends on kde libs Evo2. |
This is not really a QT problem, but how the script that you are trying to run works. Possibly a work around is to write a wrapper script which will receive a password and then call the script that you want to run, avoiding the interactive demands of sudo. If you gave some more information I might be able to give you a better answer. What does the script you want to run do, why do you need to use sudo?
|
Quote:
thank you for your reply,actually i want to run an IPTABLES command which needs "sudo" as prefix,in terminal i write Code:
sudo ./my prog Code:
sudo iptables ------ i hope you understand now my problem :scratch: |
Flicking through the man pages for sudo. It looks that you can use the -A option to get a GUI to capture and then return the password to sudo, this is not something that I have done the man pages says that you will need to set up the SUDO_ASKPASS setting but that may be worth playing around with.
|
Edit /etc/sudoers to contain something like...
Code:
hdinn ALL = NOPASSWD: /path/to/myprog |
All times are GMT -5. The time now is 03:44 AM. |