How Do I Run a Program as Root in Ubuntu?
Contents

How do I open a program as root in Ubuntu?

If you want the app to always run as root

  1. Pin the application to the launcher as normal.
  2. Locate the applications . desktop file which will be in either: …
  3. Open with gedit: gksudo gedit /usr/share/applications/APPNAME.desktop.
  4. Then change the line Exec=APP_COMMAND. to Exec=gksudo -k -u root APP_COMMAND.
  5. Save.

How can you run an executable as root?

First, open the Terminal, then mark the file as executable with the chmod command. Now you can execute the file in the terminal. If an error message including a problem such as ‘permission denied’ appears, use sudo to run it as root (admin). Be careful, sudo allows you to make critical changes to your system.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest