Skip to content
Try to downgrade the permissions of a process with root privileges
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.jshintrc
.travis.yml
index.js
license
package.json
readme.md
test.js

readme.md

downgrade-root Build Status

Try to downgrade the permissions of a process with root privileges

Usually applies to a process started with sudo.

Windows is gracefully ignored as it lacks a way to set UID.

Install

$ npm install --save downgrade-root

Usage

var downgradeRoot = require('downgrade-root');

try {
	downgradeRoot();
} catch (err) {
	console.error('Couldn\'t downgrade permissions');
}

Tip

Useful for trying to downgrade permission before blocking using your app as root.

License

MIT © Sindre Sorhus

You can’t perform that action at this time.