> For the complete documentation index, see [llms.txt](https://manual.dxable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.dxable.com/1password/manage-ssh-keys.md).

# SSH鍵を管理する

[必要条件](https://developer.1password.com/docs/cli/ssh-keys/#requirements)

1Password CLIを使ってSSH鍵を管理する前に、次のことを行う必要があります。

* 1Passwordに[サインアップしてください。](https://1password.com/pricing)
* [1PasswordCLI (2.20.0以降) をインストールしてください。](https://developer.1password.com/docs/cli/get-started#step-1-install-1password-cli)

### SSH鍵を生Createする <a href="#yoeehb7lv4cj" id="yoeehb7lv4cj"></a>

[op item create](https://developer.1password.com/docs/cli/reference/management-commands/item#item-create)コマンドにsshアイテムカテゴリーを指定して使うと、新しい SSH鍵を生成できます。保存済みのSSH鍵をインポートするには、 [1Passwordデスクトップ アプリを使います](https://developer.1password.com/docs/ssh/manage-keys/#import-an-ssh-key)。

op item create --category ssh --title "My SSH Key"

1Password CLIはSSH鍵を生Createし、それを組み込みの[Personal](https://support.1password.com/1password-glossary/#personal-vault)、[Private](https://support.1password.com/1password-glossary/#private-vault)、または[Employee ](https://support.1password.com/1password-glossary/#employee-vault)のvault（保管庫）に新しい項目としてSaveし、その後に秘密鍵を暗号化した状態で鍵をstdoutに出力します。項目には、鍵の種類、秘密鍵、公開鍵、そのフィンガープリントが含まれます。

デフォルトでは、1Password CLIはEd25519鍵をCreateします。代わりにRSA鍵を生Createさせるには、--ssh-generate-keyフラグを使ってRSAを指定します。カスタム サイズを指定するには、ビット数（2048、3072、または4096（デフォルト））を含めます:。

\
例えば、2048ビット長のRSA鍵を生Createするには、次のようにします。

op item create --category ssh --title "RSA SSH Key" --ssh-generate-key RSA,2048

### 秘密鍵を取得する <a href="#q54ixe2at45d" id="q54ixe2at45d"></a>

SSH鍵の秘密鍵を取得するには、[op read](https://developer.1password.com/docs/cli/reference/commands/read/)コマンドにアイテムのprivate keyフィールドの[シークレット参照](https://developer.1password.com/docs/cli/secret-reference-syntax/)を指定して使います。OpenSSH形式で秘密鍵を取得するには、クエリーパラメーターssh-formatをopensshと共に含めます。

op read "op\://Private/ssh keys/ssh key/private key?ssh-format=openssh"\
結果の例：

\-----BEGIN OPENSSH PRIVATE KEY-----

b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABD3rRrf8J

ruD0CxZTYfpbTYAAAAEAAAAAEAAAAzAAAAC3NzaC1lZDI1NTE5AAAAIJ5B/GnxX6t9jMwQ

G7QE7r5daJLkMKTZhNZhWfvzK2y+AAAAkLgQAivYu/+12/YrZhK5keIAZf4ZgsZsZ2JI2q

qbx23PqgO93oGy1iCxXe3kngQL4cM6lwOZPsZPKCinkN6KxEr6RnXqFRHJbMpOiGeZhTuD

rjeo77HqFdxDqDeckB77XCKL0Ew28H5JlM/WO31XR3Z4VBAgTe+BQLjrFV8WU5UX38hpBJ

PMJyRsK72ZUDDaGQ==

\-----END OPENSSH PRIVATE KEY-----

### さらに理解を深めるには <a href="#mtxlt54zuvyh" id="mtxlt54zuvyh"></a>

* [Supported SSH key types](https://developer.1password.com/docs/ssh/manage-keys#supported-ssh-key-types)
* [Use 1Password for SSH & Git](https://developer.1password.com/docs/ssh/)
* [Manage your SSH keys in the 1Password app](https://developer.1password.com/docs/ssh/manage-keys/)
* [Sign your Git commits with SSH](https://developer.1password.com/docs/ssh/git-commit-signing/)


---

# 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 dynamically by asking a question.

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

```
GET https://manual.dxable.com/1password/manage-ssh-keys.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.
