Skip to content

SSH Keys 加密算法 ed25519 和 rsa 的比较及生成教程 #17

@nkypy

Description

@nkypy

首先介绍一下


ed25519加密解密很快,生成时间短而且安全性更高,rsa则加密解密稍慢,生成时间长,安全性没有ed25519高,只是rsa基本都是默认,所以用的人更多,但是建议转换为ed25519,网站软件现在基本都支持了.

生成教程


ssh-keygen -t ed25519 -C "XXX" (XXX为标记,随便起个名称)
(回车,返回结果)
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/xxx/.ssh/id_ed25519): (文件保存位置,一般默认就好)
(回车,返回结果)
Enter passphrase (empty for no passphrase): (密码,如果想使用时不输密码,留空即可)
(回车,返回结果)
Enter same passphrase again: (再次确认密码,留空的还是直接回车)
(回车,返回结果)
Your identification has been saved in /home/xxx/.ssh/id_ed25519.
Your public key has been saved in /home/xxx/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx XXX(这几位是最上面填写的名称,在在公钥最后显示)
The key's randomart image is:(返回的随即生成图形)
+--[ED25519 256]--+
|                 |
|                 |
|                 |
|                 |
| xxxxxxxxxxxxxxx |
|ooooooooooooo    |
|                 |
|                 |
|                 |
+----[SHA256]-----+

这样ed25519算法的密钥就生成完毕了, id_ed25519.pub是公钥,粘贴到github之类的网站即可,id_ed25519是私钥,一定要保存好,且不能随便给他人,祝您使用愉快.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions