> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/add-elevated-credentials-to-session-entries.md).

# Add elevated credentials to session entries

Add elevated credentials to Remote Desktop Manager session entries, open sessions with them, and elevate SSH Terminal shells with sudo or su.

Session entries in Remote Desktop Manager support elevated (alternate) credentials that can be used instead of the credentials of the entry. To configure them, open the entry's ***Properties*** – ***Connection*** – ***Alternate***, and choose a credential mode from the ***Credentials*** list. The ***Alternate*** section is not available on macOS. Its settings are described in [Alternate](https://docs.devolutions.net/rdm/knowledge-base/knowledge-base-articles/entry-settings/common-settings/alternate.md).

Elevated credentials can be used in three ways:

* To open the session with the elevated account instead of the account of the entry.
* To type the elevated credentials in an opened session, with typing functions or variables.
* For SSH Terminal entries, to elevate the shell with `sudo` or `su`.

### Open a session with elevated credentials

To open a session with the elevated credentials, right-click on the entry, then select ***Open with parameters*** – ***Open using elevated credentials***.

The session then logs in with the elevated account instead of the account of the entry. Remote Desktop Manager does not run any elevation command such as `sudo` or `su`: in an SSH Terminal session, the shell is a regular shell of the elevated account. If the entry has no elevated credentials, the session opens with the credentials of the entry. ***Open using elevated credentials*** is available on Windows only.

### Type the elevated credentials in a session

In an opened session, the elevated credentials can be typed with the ***Type elevated username***, ***Type elevated domain*** and ***Type the elevated password*** functions.

The elevated credentials are also available as variables, for example in macros: `$ELEVATED_USERNAME$`, `$ELEVATED_DOMAIN$` and `$ELEVATED_PASSWORD$`.

{% hint style="info" %}
`$ELEVATED_PASSWORD$` is replaced by the password only when ***Allow password in variable*** is checked in the ***Security settings*** of the entry. In an advanced workspace, ***Allow password variables for all entries*** must also be checked in ***Administration*** – ***System settings*** – ***Password management*** – ***Password settings***. Otherwise, the variable is typed as is. See [Allow password in variable](https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/allow-password-in-variable.md).
{% endhint %}

### Elevate the shell of an SSH Terminal session

***SSH Terminal*** entries have an ***Elevation settings*** group in ***Properties*** – ***Connection*** – ***Alternate***. It controls the ***Elevate shell*** command of the terminal toolbar and ribbon. ***Elevate shell*** is available on Windows and Linux.

When the user clicks ***Elevate shell*** in an opened session, Remote Desktop Manager types the elevation command and the elevated password in the terminal. The shell is never elevated automatically when the session opens, whatever the ***Elevation mode***.

<table><thead><tr><th width="220">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><em><strong>Elevation mode</strong></em></td><td><ul><li><em><strong>Automatic</strong></em>: the <em><strong>Elevate shell</strong></em> command is offered in the session. The user clicks it to elevate the shell. This is the default value.</li><li><em><strong>Manual</strong></em>: the <em><strong>Elevate shell</strong></em> command is not offered. The user elevates the shell themselves, for example by typing the command and using <em><strong>Type the elevated password</strong></em>, or with a post-login macro that sends <code>$ELEVATED_PASSWORD$</code>.</li></ul></td></tr><tr><td><em><strong>Elevation tool</strong></em></td><td><ul><li><em><strong>Sudo</strong></em>: elevates the shell with <code>sudo</code>. This is the default value.</li><li><em><strong>su</strong></em>: elevates the shell with <code>su</code>.</li><li><em><strong>None</strong></em>: the <em><strong>Elevate shell</strong></em> command is not offered, even with the <em><strong>Automatic</strong></em> elevation mode.</li></ul></td></tr></tbody></table>

With ***Sudo***, ***Elevate shell*** types the following, in order:

1. `export SUDO_PROMPT=Password:`, so that the password prompt is recognized.
2. `sudo -K`, which clears the cached sudo credentials.
3. `sudo -i` to open a root shell, or `sudo -i -u <username>` to open a shell of the elevated user.
4. The elevated password, once the `Password:` prompt appears. Remote Desktop Manager waits up to 5 seconds for the prompt.

With ***su***, ***Elevate shell*** types `su` to open a root shell, or `su - <username>` to open a shell of the elevated user, then the elevated password when the `Password:` prompt appears, with the same 5-second wait. The password prompt of the server must contain `Password:`; `su` prompts translated by the server locale are not recognized.

The root form (`sudo -i` or `su`) is used when the elevated username is empty, is `root`, or is the same as the username of the session.

{% hint style="warning" %}
By default, `sudo` asks for the password of the logged-in user, while Remote Desktop Manager types the elevated password. With ***Sudo***, use elevated credentials whose password is the password of the session account, unless the server's `sudoers` uses `targetpw` (asks for the target user's password) or `rootpw` (asks for the root password). To switch to another account with that account's own password, use ***su***.
{% endhint %}

When all the ***Alternate*** settings of the entry are left at their default values, ***Elevate shell*** is offered only if the entry has a password, and it then uses `sudo` with the password of the entry. When the elevated credentials have no password, the password of the entry is typed instead.

To switch to another user with a post-login macro instead of the ***Elevate shell*** command, see [Connect with su-user in SSH sessions](https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/connect-with-su-user-in-ssh-sessions.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/add-elevated-credentials-to-session-entries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
