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

{% hint style="success" %}
パスワードのローテーションには、KeeperPAMによるゼロトラスト方式もあります。ほとんどの用途では、そちらの利用を推奨します。詳細は以下をご参照ください。

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

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

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

対話型シェル、CLI、JSON設定ファイルのいずれでも、以下のコマンドが使えます。コマンドごとに追加のパラメータとオプションがあります。

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

`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" %}
詳細と例については、[ホストへの接続に関するページ](/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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/plugins/password-rotation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
