Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute process as current Mac OS X user, not as root

I have created a Mac OS X helper application that always runs under root. I need to launch other application from it, but not as root. I want it to be launched from the current logged in user (not sudoed root).

I've tried to use [NSTask launchedTaskWithLaunchPath:arguments:] and many other methods, but they all use root privileges to launch my application.

How can I launch my application from helper as a current Mac OS X logged in user?

like image 629
Daniel O'Hara Avatar asked Nov 21 '11 15:11

Daniel O'Hara


People also ask

How do I change root user to normal user on Mac?

in the Directory Utility window, then enter an administrator name and password. From the menu bar in Directory Utility: Choose Edit > Enable Root User, then enter the password that you want to use for the root user. Or choose Edit > Disable Root User.

How do I disable root user on Mac?

You can disable it from the Directory Utility, which you can access as outlined above using System Preferences > Users & Groups > Login Options. From Directory Utility, click “Edit” in the menu bar and you'll find the “Disable Root User” and “Change Root Password” commands.

Does MacOS have a root user?

Mac administrators can use the root user account to perform tasks that require access to more areas of the system. The user account named ”root” is a superuser with read and write privileges to more areas of the system, including files in other macOS user accounts. The root user is disabled by default.

What is root user on Mac activity monitor?

The user named root, or superuser, is a special user account in UNIX-like operating systems that has unrestricted read and write privileges to all areas of the file system in OS X 10.10 or earlier. However, in OS X 10.11 or later, the root user's write access to certain areas of the file system is restricted.


1 Answers

It looks like the Authorization Services Programming Guide might help you.

like image 123
dar512 Avatar answered Oct 21 '22 05:10

dar512