Debug as root
In CLion, you can run and debug applications with root privileges.
The Run with root privileges (on macOS and Linux) / Run with Administrator privileges (on Windows) option is available for the following configurations:
Test frameworks' configurations (Boost.Test, Catch2, CTest Application, Doctest, and Google Test)
Enable debugging as root
In the main menu, go to .
Select the configuration and set the Run with root privileges checkbox.

When this checkbox is selected, the configuration is launched with root privileges for running or debugging.
Configure authorization time
If you do not want to authorize each time you run or debug an application with elevated privileges, you can configure the amount of time the authorization is kept. This is similar to how the sudo command-line program works by default.
When you run or debug with elevated privileges for the first time, you will be prompted to choose whether to authorize every time or grant authorization for the configured period. You will always be able to change this in the settings.

CLion does not have access to passwords. The system dialog manages authorization. After the configured time runs out, running elevated processes continue to run, but no new elevated process starts until you authorize it again.
Set the authorization period in the settings
You can also configure the time the authorization is kept in the settings.
Go to .
Select the Keep 'sudo' authorization for (Keep UAC authorization for) checkbox and specify the value. The default is 15 minutes.

Current limitations
For MinGW and Cygwin on Windows, there's an issue with pausing a session when debugging as Administrator (CPP-22883).
On macOS, the process isn’t finished correctly when running as root with the profiler (CPP-22842).
For remote mode, there's an issue with the overall elevation configuration (CPP-22920).