Skip to content

jitsudo shell

Open an interactive shell with elevated credentials injected into the environment.

jitsudo shell <request-id> [--shell <shell-binary>]

jitsudo shell fetches the active credentials for an elevation request and drops you into an interactive shell subprocess with those credentials injected as environment variables.

Key security property: The parent shell never receives the credentials. They exist only in the child shell’s environment and are discarded on exit.

When the shell opens, a warning banner is printed to stderr showing the request ID and credential expiry time:

*** jitsudo elevated shell — request req_01J8KZ... ***
*** Credentials expire at 2026-03-20T18:00:00+00:00 ***
*** Type 'exit' to leave the elevated context ***

Two additional variables are injected regardless of provider:

  • JITSUDO_ELEVATED=1 — marks the shell as elevated
  • JITSUDO_REQUEST_ID=<id> — the active request ID

You can use these in your shell prompt (e.g. PS1) to visually indicate when you are in an elevated context.

ArgumentDescription
<request-id>The ID of an active elevation request
FlagDefaultDescription
--shell <path>$SHELL env var, then /bin/shShell binary to launch
FlagDefaultDescription
--server <url>Stored credentialsControl plane URL
--token <token>Stored credentialsBearer token override
-q, --quietfalseSuppress non-essential output
--debugfalseEnable debug logging
Terminal window
# Open an elevated shell using your default shell
jitsudo shell req_01J8KZ4F2EMNQZ3V7XKQYBD4W
# Explicitly use zsh
jitsudo shell req_01J8KZ4F2EMNQZ3V7XKQYBD4W --shell zsh
# Verify credentials are injected
jitsudo shell req_01J8KZ4F2EMNQZ3V7XKQYBD4W
$ env | grep AWS_
AWS_ACCESS_KEY_ID=ASIA...
AWS_SECRET_ACCESS_KEY=...
AWS_SESSION_TOKEN=...
AWS_DEFAULT_REGION=us-east-1
$ exit

In addition to the provider-specific variables, the shell always receives:

VariableValue
JITSUDO_ELEVATED1
JITSUDO_REQUEST_IDThe active request ID

Provider-specific variables:

ProviderVariables injected
awsAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_DEFAULT_REGION
gcpGOOGLE_CLOUD_PROJECT
azureAZURE_SUBSCRIPTION_ID
kubernetesJITSUDO_K8S_ROLE, JITSUDO_K8S_NAMESPACE

Add this to your .zshrc or .bashrc to visually indicate an elevated context:

Terminal window
# Show [ELEVATED] in the prompt when inside a jitsudo shell
if [[ -n "$JITSUDO_ELEVATED" ]]; then
PS1="[ELEVATED:$JITSUDO_REQUEST_ID] $PS1"
fi
jitsudo shelljitsudo exec
Use caseInteractive investigationScripted / single command
SessionStays open until you exitExits when the command completes
Best forDebugging, explorationCI pipelines, automation