Reference
Arcane.users.restoreShell()
Restores the recorded supported shell configuration.
This focused page is derived from the mechanically checked full member inventory.
Syntax
Arcane.users.restoreShell(username)
Parameters
Username
Return value
Promise<{user, operation, credentials}>
Description
Restores the recorded supported shell configuration.
Overview
Arcane.users.restoreShell(username) restores the exact prior shell values
captured before Arcane assigned its login shell. It requires users.manage, the
Provisioner type, elevation, and the exclusive Core mutation boundary. It does
not delete the account or change its password, but it materially changes what
starts at the user's next sign-in.
Microsoft NT restores both prior policy and legacy shell bindings, including their recorded absence. Linux restores the recorded login shell after checking the exact uid and ensuring the prior executable still exists. The host refuses to overwrite a value changed outside the recorded transaction.
Result, side effects, and events
The exact result is {user, operation, credentials} with empty credentials.
user contains username, restored: true, the restored nullable shell,
shellAssigned: false, and verification, plus Microsoft NT binding fields or
Linux profile and uid. Recovery can also report alreadyRestored: true.
Standard operation events are emitted.
Errors and recovery
SHELL_BACKUP_NOT_FOUND means there is no safe baseline. A staged account must
be activated or recovered before restore. SHELL_CHANGED_EXTERNALLY, changed
SID/uid errors, or PREVIOUS_SHELL_MISSING block mutation rather than guessing.
Review the account and protected recovery record manually; do not substitute a
default shell silently.
Example
async function restoreShellAfterVerification(username, confirmRestore) {
const verification = await Arcane.users.verifyShell(username);
if (!confirmRestore(verification.user)) {
return null;
}
return Arcane.users.restoreShell(username);
}