项目作者: Nikhil0487
项目描述 :
A CLI tool to switch admin privileges for macOS
高级语言: Swift
项目地址: git://github.com/Nikhil0487/PrivilegesCLI.git
Warning:
This repo is archived and the latest tool has been moved to https://github.com/Nikhil0487/privileges-CLI
PrivilegesCLI
A CLI tool to switch admin privileges for macOS. This is inspired from SAP’s Privileges app.
About
This repository aims to build a CLI only tool to switch/toggle admin privileges.
Goals
This repository’s goals are as follows:
- CLI tool should run in user context,
- Privilege operations should happen via XPC Mach service daemon,
- The code should be fully in Swift,
- Use Apple’s new Argument Parser library,
Design
Proposed design:
- Build a package with user CLI and XPC daemon,
- Installing the package will start the deamon and install the CLI tool,
- When the CLI is invoked, CLI asks XPC to do appropriate privilege change to the currently
logged in user, - Uninstallation can also be done in user privilege if possible and make XPC to shut down
itself
TODO
Usage
Build both XPC helper and privileges CLI tool.
- Copy the com.privilge.helper XCP to /Library/PrivilegeHelper directory,
- Load the XPC daemon plist,
./privilege —user “username” —admin true
Future Scope
Contributions are welcome.