> 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/da/knowledge-base/how-to-articles/connect-with-su-user-in-ssh-sessions.md).

# Opret forbindelse med su-bruger i SSH-sessioner

Konfigurer makroer efter logon i en SSH-post i Remote Desktop Manager, så der automatisk skiftes til en su-bruger under sessionen.

Unix-kommandoen ***su***, der er afledt af ***substitute user***, giver en bruger mulighed for at køre kommandoer med privilegierne fra en anden brugerkonto.

### Opret forbindelse med su-bruger i SSH-sessioner

1. I Remote Desktop Manager skal De åbne ***Egenskaber.*** for Deres SSH-post.
2. Gå til ***Sikkerhedsindstillinger***, og markér afkrydsningsfeltet ***Tillad adgangskode i variabel***.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Hvis valgmuligheden er nedtonet, skal De aktivere <em><strong>Tillad adgangskodevariabler for alle poster</strong></em> og <em><strong>Tillad adgangskodevariabel i makroer</strong></em> under <em><strong>Administration</strong></em> – <em><strong>Systemindstillinger</strong></em> – <em><strong>Adgangskodeindstillinger</strong></em>. Bemærk også, at hvis De bruger en af legitimationsoplysningstilstandene <em><strong>Tilknyttet (boks)</strong></em> eller <em><strong>Tilknyttet (ekstern boks)</strong></em> til Deres post, skal De også markere feltet <em><strong>Tillad adgangskode i variabel</strong></em> i den tilknyttede bokspost.</p></div>
3. Gå derefter til ***Generelt*** – ***Efter logon***, og klik på ***Ny*** (krydsformet knap).
4. Angiv `sudo su` i vinduet ***Makroredigering***. En ***Forventet prompt*** er ikke nødvendig, fordi vi vil køre den så hurtigt som muligt i dette scenarie.
5. Gå tilbage til ***Generelt*** – ***Efter logon***, og klik på ***Ny*** (krydsformet knap).
6. Angiv variablen `$PASSWORD$` og `[sudo] password for username:` i ***Forventet prompt*** (***brugernavn*** bruges som eksempel).
7. Angiv en ***Timeout.***, og klik på ***OK*** for at lukke vinduet.

Målet er at sikre, at adgangskoden kun sendes, når tidspunktet passer med den tilsigtede rækkefølge af handlinger. Terminalen venter på prompten `[sudo] password for username:`, før den sender den anden kommando.


---

# 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/da/knowledge-base/how-to-articles/connect-with-su-user-in-ssh-sessions.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.
