On Linux, how to add a build step in Qt Creator that uses su rights without getting the wrong password attempts in assemblies?

My goal is to successfully associate the folder with / opt / directory, which must be started using sudo.

I tried this:

 system(sudo ln -s $$OUT_PWD/xampp /opt/lampp):message("You should manually link LAMPP")

But building from qt-creator does not ask for the sudo password, so I could not get it to link this folder. I got the error "Password Errors ..." in the compiler output. Then I tried them with the build steps:

make
sudo make install

to find out if he would notify me of this, but at the stage, make installthe same error was not possible as in detail:

00:31:20: Starting: "/usr/bin/sudo" make install
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
00:31:20: The process "/usr/bin/sudo" exited with code 1.

system() qmake script , qmake && make && make install , sudo ln...; , CTRL-B Qt Creator sudo...

Qt Creator ? sudo pass Qt Creator ( )... , , , ? prompt() qmake sudo?

...

+5
3

:

ssh-askpass Sudo Password | sudo -S bash ./script

, /. . , sudo , -S.

echo "password" | sudo -S bash ./script

bash , , , sudo script. , .

+3

@Logan sudo ssh-askpass ( GUI) -A, SUDO_ASKPASS /usr/bin/ssh-askpass, /etc/sudo.conf [1] (, gksudo kdesudo @herophuong). , "password" , . :

sudo -A -s ./script

, sudo , , ( 5 ?), , . / script ( - ), sudo -K - , ( ), sudo .

1 - visudo root, /etc/sudo.conf, :

# Path to askpass helper program
Path askpass /usr/bin/ssh-askpass

>

+1

, gksudo ( GNOME) kdesudo ( KDE). .

0
source

All Articles