0
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?

More than 3 years have passed since last update.

SSH keys 備忘録

Last updated at Posted at 2020-05-21

背景と目的

ssh keysの作り方を毎回忘れてしまうので備忘録として残しておく

コマンド

ssh-keygen -t rsa -b 4096 -C "mailadress"
  • t オプション キーペアの指定
  • b オプション 鍵のbit数
  • C オプション コメントの挿入 ※メールアドレス入れるのがお作法?

実行結果

$ ssh-keygen -t rsa -b 2048 -C XXX@example.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/XXXX/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/XXXX/.ssh/id_rsa.
Your public key has been saved in /c/Users/XXXX/.ssh/id_rsa.pub.

公開鍵と秘密鍵が.ssh配下にできる。公開鍵は然るべきところに登録して削除しておく

$ ls -l ~/.ssh/
total 13
-rw-r--r-- 1 XXXX 197609   62 5月  21 17:10 config
-rw-r--r-- 1 XXXX 197609 3326 5月  21 17:22 id_rsa
-rw-r--r-- 1 XXXX 197609  744 5月  21 17:22 id_rsa.pub
-rw-r--r-- 1 XXXX 197609 2083 5月  21 17:01 known_hosts

0
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
0
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?