Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7960995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:54:31+00:00 2026-06-04T04:54:31+00:00

My goal is to successfully link a folder to /opt/ directory- which needs to

  • 0

My goal is to successfully link a folder to /opt/ directory- which needs to be run with sudo.

I have tried this:

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

But building from qt-creator it does not prompt for sudo password, therefore I couldn’t get it to link the folder. I got the “wrong password attempts…” error in the Compiler Output. Then I tried these with build steps:

make
sudo make install

to see if it would prompt me there, but it failed on make install step with the same error, which is this 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.

The system() function in the qmake script works fine when I use qmake && make && make install from terminal since it prompts me before sudo ln... command; but for fast testing purposes I feel that building with CTRL-B inside Qt Creator should also work with sudo commands…

Is there a way to be prompted from Qt Creator, or a way around this? Like storing the sudo pass within the Qt Creator (although it is risky)… Or maybe making it run build steps on a terminal where it would prompt me? Would prompt() function in qmake work with gathering sudo passwords?

Any suggestions are welcome…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:54:32+00:00Added an answer on June 4, 2026 at 4:54 am

    After a lot of research:

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

    Worked like a charm, it asks for the password in a separate window/prompt box. I added it under custom build steps. The important thing is to let sudo know that it will expect a password input via -S option.

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

    Also works with bash scripts, however as you might think it is insecure storing the sudo password inside the script. It is said that read permissions should fix that issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have come unstuck with this goal after successfully using a dataModel when rendering
I receive this error when I try to run the maven goal - mvn
I have a Maven project in Eclipse that successfully reaches the package goal. In
I have the following profile which I am executing successfully (mvn exec:exec -DrunMule): <profile>
Okay, so I've successfully completed my goal using buttons which was merely a test.
My ultimate goal is to successfully link to a number of DLLs (opengl32.dll glfw.dll
goal: I have the string 1234432144 I want to only replace the first 2
I have successfully implemented code to plot multiple locations on google maps dynamically. Solution:
So I was successfully able to run a command line application with various arguments
My goal is to change the onclick attribute of a link. I can do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.