Skip to main content

Stage a desired-state sudoers file for a Linux computer

POST 

/computers/:computerId/sudoers

Stores the supplied full sudoers text as the staged (desired-state) sudoers.

It replaces any earlier staged document; individual lines cannot be patched. Nothing is written to the computer until Protect is enabled (or, if Protect is already on, until the next sync). Accounts named in the sudoers are reflected in the admin inventory, and inventory changes are reflected in the staged sudoers (inventory entries not named in the new text are dropped). The text is parsed with a trailing newline removed; the hash identifies the content.

Returns 400 if sudoers_blob is missing or empty, or the computer is not Linux. A non-string sudoers_blob (for example 123) is passed to the sudoers service and ends in 500. Errors from the sudoers service are passed through with that service's status and a {message} body.

The server returns 500 when the request is made with the built-in secureone account: the staged document is created and then the call fails, and later GET and DELETE calls return 500 until a directory user stages a new sudoers; use a directory user's token to avoid it. Also, when the service fails downstream (for example a missing service-account password), the staged document is still saved on the computer. Accepts JSON and application/x-www-form-urlencoded.

Required role: superadmin or admin.

Request​

Responses​

Staged sudoers stored.