LoginSignup
14
4

More than 1 year has passed since last update.

sshの鍵作成 ed25519

Posted at
  • 最近強いと言われているed25519の鍵を作る。
  • Enter passphreseのところでパスワードを設定する。sshするときにパスワード聞かれるのが嫌な人はそのままEnterでOK

  • 作成すると自分のhomeディレクトリの下にsshの鍵が生成される。

    • .pubとなっているのが公開鍵
    • なにもついていないのが秘密鍵
  • よく秘密鍵を送ってきてサーバに登録してくださいという人いるけど、公開鍵は公開してもいいけど、秘密鍵は自分だけの秘密にして置いてください。

    • 秘密鍵を公開すると後悔します。
pupupupupu@devPC dev % ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/pupupupupu/.ssh/id_ed25519): 
Created directory '/Users/pupupupupu/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/pupupupupu/.ssh/id_ed25519.
Your public key has been saved in /Users/pupupupupu/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:GmuekgaxWW3tfjpGBu6ev1riCvI6xPfxvC3yETsxAQI pupupupupu@devPC.local
The key's randomart image is:
+--[ED25519 256]--+
| E.. .           |
|    . .          |
|     . o         |
|  . . + o        |
|.  = o.*S        |
| o+. ..+O        |
|o o..oOB.        |
|.o .+*.OB .      |
|.o...+X***       |
+----[SHA256]-----+
hoge@devPC dev % ls ~/.ssh/id_ed25519
/Users/pupupupupu/.ssh/id_ed25519
pupupupupu@devPC dev % ls ~/.ssh/id_ed25519.pub 
/Users/pupupupupu/.ssh/id_ed25519.pub
pupupupupu@devPC dev % ls -la ~/.ssh/          
total 16
drwx------   4 pupupupupu  staff  128  7 29 19:14 .
drwxr-xr-x+ 18 pupupupupu  staff  576  7 29 19:14 ..
-rw-------   1 pupupupupu  staff  464  7 29 19:14 id_ed25519
-rw-r--r--   1 pupupupupu  staff  100  7 29 19:14 id_ed25519.pub
pupupupupu@devPC dev % 
14
4
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
14
4