> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/plugins/password-rotation.md).

# パスワードローテーションコマンド

ターゲットシステムでパスワードローテーションを実行するためのコマンド。

{% hint style="success" %}
KeeperPAMを使用したゼロトラストのパスワードローテーション機能もリリースされました。この新機能は、パスワードローテーションのほとんどの場面で推奨されます。詳細については以下をご参照ください。

* [KeeperPAMを使用したパスワードローテーション](/keeperpam/jp/privileged-access-manager/password-rotation.md)
* [コマンダーのKeeperPAMコマンド](/keeperpam/jp/commander-cli/command-reference/keeperpam-commands.md)
  {% endhint %}

## ローテーションコマンド

#### Keeperコマンドリファレンス

対話型シェル、CLI、JSON設定ファイルのいずれからでも、Keeperでは以下のコマンドを利用できます。各コマンドには、追加のパラメータとオプションがあります。

特定のコマンドのヘルプを表示するには、以下のコマンドを実行します。

`help <command>`

| コマンド             | 説明                      |
| ---------------- | ----------------------- |
| `rotate` または `r` | レコードのパスワードをローテーション      |
| `set`            | 他のコマンドまたは引数内の置換用環境変数の設定 |
| `echo`           | 環境変数の表示                 |

### rotateコマンド: <a href="#rotate-command" id="rotate-command"></a>

**コマンド:** `rotate` または `r`

**詳細:** レコードのパスワードをローテーション

ローテーションの対象となるには、レコードに `cmdr:plugin` = `noop` のカスタムフィールドが必要です

**パラメータ:**

ローテーション対象のレコード名またはUID

**スイッチ:**

`--print` ローテーション後の更新済みレコード内容の表示

`--match` `<REGULAR EXPRESSION>` この式に一致するすべてのレコードを選択してローテーション

`--password` `<NEW PASSWORD>` 新しいパスワードの設定。スイッチを省略した場合はランダムなパスワードを自動生成。`--match` による複数レコードのローテーション時は無視

**例:**

```
rotate servers/dev
rotate BhRRhjeL4armInSMqv2_zQ --print
rotate --match [0-z]*\machine
rotate BhRRhjeL4armInSMqv2_zQ --password "XXX"
```

1. 「servers」フォルダ内のタイトル「dev」のレコードのパスワードのローテーション
2. 指定したUIDを持つレコードのパスワードのローテーション
3. 「machine」で終わるすべてのレコードのパスワードのローテーション (正規表現)
4. 指定したレコードUIDのパスワードを、指定したパスワードでローテーション

{% hint style="info" %}
`--password` を使用する場合、値に `'`, `"`, `;`, `\`, `--` を含めないでください。これらの文字が含まれていると、ローテーションに失敗します。`--password` を省略した場合は、準拠したパスワードが自動生成されます。\
詳しくは、[ホストへの接続](/keeperpam/jp/commander-cli/command-reference/connection-commands/connection-to-hosts.md)をご参照ください。
{% endhint %}

### setコマンド: <a href="#set-command" id="set-command"></a>

**コマンド:** `set`

**詳細:** 環境変数の設定

**パラメータ:**

環境変数名、設定する値

形式:

`set <name> <value>`

**例:**

```
set MySecret XXX
```

`MySecret` 変数を `XXX` に設定

### echoコマンド: <a href="#echo-command" id="echo-command"></a>

**コマンド:** `echo`

**詳細:** 環境変数の表示

**パラメータ:**

表示する引数 (任意)

形式:

`echo ${<variable>}`

引数を指定しない場合は、すべての環境変数の表示

**例:**

```
echo
echo ${MySecret}
```

1. 設定済みのすべての環境変数の表示
2. `MySecret` 変数の値の表示


---

# 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.keeper.io/keeperpam/jp/commander-cli/command-reference/plugins/password-rotation.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.
