How to get admin privileges in macOS client

Hi I’m a developer from South Korea.
I was wondering how did you get admin(sudo) in your client app.

as far as I know, you need admin privilege to open utun driver in macOS, otherwise connection fails because of insufficient permission.

in command line, you can sudo ./openvpn --config xxx.ovpn and type admin password.

But with GUI(electronjs) how could this be achieved?

By the way, In Windows, you can specify app to start with admin privilege by setting requestedExecutionLevel to requireAdministrator. But I couldn’t find that in your code either.

Thanks for your support and I’m sorry in advance if this place was not for asking development questions. I couldn’t find an issue tab in github.

On macOS a root service is used sudo launchctl print system/com.pritunl.service. On Windows a background administrator service named pritunl is used. The client GUI doesn’t run elevated on any operating system.

Communication between the service and GUI is done with file sockets on macOS and Linux. On Windows TCP is used. Both types use HTTP and WebSockets for the communication.

1 Like