> 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/cli/de/anleitungen/secrets/update-a-secret.md).

# Ein Geheimnis aus einem Skript aktualisieren

Ein neues Passwort aus einem Skript mit devo secret set in einen Eintrag schreiben und den Wert aus einer Umgebungsvariable oder einer Datei lesen, nie von der Befehlszeile.

Wenn ein Skript ein Passwort wechselt, einen API-Schlüssel erzeugt oder ein neues Token empfängt, kann es den Wert mit `devo secret set` direkt in Ihrem Tresor speichern. Der neue Wert kommt aus einer Umgebungsvariable oder einer Datei, nie von der Befehlszeile.

## Den neuen Wert schreiben

`devo secret set` nimmt das Feld, dann den Eintrag. Fügen Sie `--yes` hinzu, um die Änderung zu bestätigen: Ohne diese Option wird nichts geschrieben.

{% tabs %}
{% tab title="From an environment variable" %}

```bash
devo secret set password "<entry-name>" --value-env NEW_PASSWORD --yes
```

`--value-env` nimmt den **Namen** der Variable, nicht ihren Wert.
{% endtab %}

{% tab title="From a file" %}

```bash
devo secret set password "<entry-name>" --value-file <path-to-file> --yes
```

{% endtab %}
{% endtabs %}

Verwenden Sie genau eine der Optionen `--value-env` oder `--value-file`. Um den Eintrag nach ID auszuwählen, schreiben Sie `id:<entry-id>` oder fügen Sie `--id` hinzu; `--vault-id` wählt den Tresor. Um in einen anderen Workspace als den aktuellen zu schreiben, fügen Sie `--context <context-name>` hinzu.

Erzeugen Sie zum Beispiel ein Passwort und speichern Sie es, ohne es je anzuzeigen:

```bash
NEW_PASSWORD="$(devo generate password)" devo secret set password "<entry-name>" --value-env NEW_PASSWORD --yes
```

## Was jeder Workspace-Typ schreiben kann

<table><thead><tr><th width="260">WORKSPACE</th><th>FELDER, DIE SIE SCHREIBEN KÖNNEN</th></tr></thead><tbody><tr><td><strong>Devolutions Server</strong></td><td>Jede Dateneigenschaft des Eintrags, etwa <code>password</code>, <code>username</code>, <code>domain</code> oder <code>host</code>. Abschnitte werden nicht unterstützt.</td></tr><tr><td><strong>Devolutions Cloud</strong></td><td>Nur <code>password</code>.</td></tr><tr><td><strong>Lokales Profil von Devolutions Remote Desktop Manager</strong></td><td>Nur <code>password</code>, für einen Workspace, der durch eine gemeinsame Passphrase geschützt ist. Siehe unten.</td></tr></tbody></table>

Jedes andere Feld auf Devolutions Cloud oder einem lokalen Profil wird mit einem Fehler abgelehnt, der sagt, dass der Workspace Schreibzugriffe nur auf das Passwortfeld akzeptiert. `devo secret capabilities --output json` beschreibt diese Regeln für jeden Workspace-Typ. Siehe [Workspace-Typen vergleichen](/cli/de/anleitungen/understand/workspace-types.md).

### Lokale Profile: die Workspace-Passphrase

Um in ein lokales Profil zu schreiben, braucht Devolutions CLI die Passphrase des Workspace. Standardmäßig liest es sie aus der Datei `<workspace file>.passphrase` im Profilordner. Um eine andere Quelle zu verwenden, fügen Sie `--passphrase-file <path>` oder `--passphrase-env <variable-name>` hinzu. Ohne Passphrase stoppt der Befehl und sagt, wo er gesucht hat. Diese beiden Optionen gelten nur für lokale Profile.

Siehe [Ein lokales Profil von Devolutions Remote Desktop Manager verwenden](/cli/de/anleitungen/connect/local-profile.md).

## Gut zu wissen

* Der Befehl gibt den neuen Wert nie aus. Bei Erfolg bestätigt er die Aktualisierung, zum Beispiel mit `Secret: updated`.
* In einer Pipeline sorgt `--yes` dafür, dass geschrieben wird; es gibt keine Eingabeaufforderung zu beantworten. Siehe [Ohne Eingabeaufforderungen ausführen](/cli/de/fur-devops-und-administratoren/automate/non-interactive.md).
* Der Befehl sagt, dass der Workspace das Feld nicht unterstützt: siehe [Ein Befehl sagt, dass der Workspace ihn nicht unterstützt](/cli/de/hilfe/troubleshooting/not-supported.md).

## Weiter

* [Generate passwords and SSH keys](/cli/de/anleitungen/generate.md)
* [Run a command with its secrets](/cli/de/anleitungen/secrets/run-with-secrets.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/cli/de/anleitungen/secrets/update-a-secret.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.
