1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ssh-keygen -t ed25519 とは何か

1
Posted at

ssh-keygen -t ed25519 とは

SSHで使う公開鍵・秘密鍵のペアを生成するコマンド。

ssh-keygen -t ed25519

-t ed25519 を指定することで、ed25519 という暗号方式を使った鍵を作成する。

ssh-keygen とは

ssh-keygen は SSH 用の鍵を作成するための標準コマンド。

主な用途:

  • サーバーへのパスワードなしログイン
  • GitHub / GitLab などでのSSH認証
  • サーバー間通信の認証

ed25519 の意味

名前の由来

  • ed :Edwards(エドワーズ)曲線
  • 25519 :暗号計算で使われる数(2^255 − 19)

つまり、
Edwards曲線を使った暗号方式で、25519という数を基にしている
という意味。

Edwards(ED)曲線とは

Edwards曲線は、楕円曲線暗号の一種で、以下の特徴がある。

  • 計算がシンプル
  • 実装ミスが起きにくい
  • 高速
  • セキュリティ事故が起きにくい
    そのため、SSHやGitHubなど現代的な環境では ed25519 が推奨されている。

-C オプションとは

ssh-keygen -t ed25519 -C "コメント"

-C は Comment(コメント) を指定するオプション。
生成される公開鍵(.pub ファイル)の末尾に識別用の文字列を付与できる。

鍵生成後に作られるファイル

通常、以下の2ファイルが生成される。

~/.ssh/id_ed25519 # 秘密鍵(絶対に他人に渡さない)
~/.ssh/id_ed25519.pub # 公開鍵(サーバーやGitHubに登録)

まとめ

  • ssh-keygen -t ed25519 は SSH用の鍵を生成するコマンド
  • ED は Edwards(エドワーズ)曲線 の略
  • 今から鍵を作るなら ed25519 を選んでおけばOK
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?