Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. run program as root
Forum Updated to NodeBB v4.3 + New Features

run program as root

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 392 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jakubiszon26
    wrote on 9 May 2021, 14:29 last edited by
    #1

    Hi, what should i do to get my qtwidgets app launching as root?. i'd like it to show password prompt and run as root. On linux

    J 1 Reply Last reply 9 May 2021, 14:55
    0
    • G Offline
      G Offline
      gde23
      wrote on 9 May 2021, 14:51 last edited by
      #2

      You can just launch it with kdesudo (on KDE) or the equivalent for other desktops, however most probably it is not a very good idea.
      Why do you want to launch it as root?

      1 Reply Last reply
      3
      • J jakubiszon26
        9 May 2021, 14:29

        Hi, what should i do to get my qtwidgets app launching as root?. i'd like it to show password prompt and run as root. On linux

        J Offline
        J Offline
        JonB
        wrote on 9 May 2021, 14:55 last edited by
        #3

        @jakubiszon26
        As @gde23 says, not a good idea, and why? If the user wants to run your app by setting himself/the launch as root that's one thing. But your app prompting and changing to root is quite another.

        Anyway, it's moot, because you probably won't be able to do as you ask. If you app runs as non-root, prompts user and gets password, that's not going to help that same app to then change to running as root. At best you might then launch a second app as root....

        And finally, beware, there can be issues running a X windows program as root, it may not work right X-wise....

        1 Reply Last reply
        1
        • K Offline
          K Offline
          Kent-Dorfman
          wrote on 10 May 2021, 02:04 last edited by
          #4
          chown root:root program
          chmod 4755 program
          

          disable selinux NSA spyware if problems persist

          no judgement...just syntax. LOL

          1 Reply Last reply
          0

          1/4

          9 May 2021, 14:29

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved