puttygen生成公私钥_如何使用Puttygen生成腻子密钥?

puttygen生成公私钥

puttygen生成公私钥

Puttygen is used to generate ssh public and private keys for putty. We can use a different type of encryption algorithm bit sizes and ssh versions. In this tutorial, we will look at useful examples of puttygen.

Puttygen用于生成SSH的SSH公钥和私钥。 我们可以使用其他类型的加密算法,位大小和ssh版本。 在本教程中,我们将看一些有用的Puttygen示例。

将Puttygen安装到Linux (Install Puttygen To Linux)

puttygen is provided with putty packages most of the Linux distributions like Ubuntu, Debian, Fedora, CentOS, RedHat.

puttygen提供了大多数Linux发行版中的putty软件包,例如Ubuntu,Debian,Fedora,CentOS,RedHat。

Ubuntu,Debian (Ubuntu, Debian)

puttygen tool is provided with the putty package in Debian, Mint, Ubuntu, Kali.

在Debian,Mint,Ubuntu,Kali的putty软件包中提供了puttygen工具。

$ sudo apt install putty
Install Puttygen To Linux
Install Puttygen To Linux
将Puttygen安装到Linux

Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)

puttygen tool is provided with the putty package in Fedora, CentOS, RedHat.

Fedora,CentOS和RedHat中的putty软件包随附了puttygen工具。

$ sudo yum install putty

视窗 (Windows)

Windows binaries are provided with the following URL.

Windows二进制文件带有以下URL。

32位 (32 bit)

https://the.earth.li/~sgtatham/putty/latest/w32/puttygen.exe

https://the.earth.li/~sgtatham/putty/latest/w32/puttygen.exe

64位 (64 bit)

https://the.earth.li/~sgtatham/putty/latest/w64/puttygen.exe

https://the.earth.li/~sgtatham/putty/latest/w64/puttygen.exe

puttygen命令语法 (puttygen Command Syntax)

The syntax of puttygen is like below. puttygen is a simple command where there are two parameters named KEYFILE, OPTIONS.

puttygen的语法如下。 puttygen是一个简单的命令,其中有两个名为KEYFILE,OPTIONS的参数。

puttygen KEYFILE OPTINONS
  • KEYFILE is the file we read

    KEYFILE是我们读取的文件

  • OPTIONS are used to specify size, output key file, etc.

    OPTIONS用于指定大小,输出密钥文件等。

从puttygen GUI创建密钥 (Create Key From puttygen GUI)

puttygen tool is provided with a GUI in Windows operating systems. We can download this GUI tool which is explained in the Download For Windows section. Then from the tool, we will be provided a simple screen where we can set different parameters about the cryptographic key creation.

Windows操作系统中的GUI附带了puttygen工具。 我们可以下载此GUI工具,这在Windows的下载部分中进行了说明。 然后,通过该工具,我们将提供一个简单的屏幕,其中我们可以设置有关密码密钥创建的不同参数。

Create Key From puttygen GUI
Create Key From puttygen GUI
从puttygen GUI创建密钥

We can see that there is 3 main part of the window.

我们可以看到窗口有3个主要部分。

  • Key part provides the key in ASCII format.

    Key部分以ASCII格式提供密钥。

  • Actions part will provide buttons for Key generation, Load Existing Key, Save Public Key, Save Private Key.

    Actions部分将提供用于生成密钥,加载现有密钥,保存公共密钥,保存私有密钥的按钮。

  • Parameters part provides the key type selection like RSA, DSA, ECDSA, ED25519, SSH-1 (RSA), and the size of the key as bits where default size is 2048 which is accepted as secure.

    Parameters部分提供了密钥类型选择,例如RSADSAECDSAED25519SSH-1 (RSA) ,以及密钥的大小(以位为单位),默认大小为2048,可以接受此保护。

LEARN MORE  How To Install and Use Linux Minicom Command Tutorial with Examples?
了解更多信息如何通过示例安装和使用Linux Minicom命令教程?

使用Puttygen GUI创建2048个RSA密钥 (Create 2048  RSA Key with Puttygen GUI)

We can generate an RSA key which is 2048 bit by using the following configuration for the puttygen. We will click on the Generate button with the default parameters. As cryptography and security are based randomness puttygen need real random data that can be provided with the random mouse hovering over the screen.

我们可以通过对puttygen使用以下配置来生成一个2048位的RSA密钥。 我们将单击带有默认参数的Generate按钮。 由于密码学和安全性是基于随机性的,因此腻子需要真正的随机数据,这些数据可以通过鼠标悬停在屏幕上来提供。

Create 2048  RSA Key with Puttygen GUI
Create 2048  RSA Key with Puttygen GUI
使用Puttygen GUI创建2048个RSA密钥

At the end of the key generation, the following screen will appear where information about the generated key will be presented.

在密钥生成结束时,将出现以下屏幕,其中将显示有关所生成密钥的信息。

Create 2048  RSA Key with Puttygen GUI
Create 2048  RSA Key with Puttygen GUI
使用Puttygen GUI创建2048个RSA密钥
  • Key fingerprint is a value that uniquely identifies the created key.

    Key fingerprint是唯一标识创建的密钥的值。

  • Key comment is a short description of the created key.

    Key comment是对创建的键的简短描述。

  • Key passphrase is a passphrase or password to encrypt the created key.

    Key passphrase是用于加密创建的密钥的密码短语或密码。

We can also create different types and sizes of the keys by changing parameters like below.

我们还可以通过更改如下所示的参数来创建不同类型和大小的键。

  • Create 2048  DSA Key with Puttygen GUI

    使用Puttygen GUI创建2048 DSA密钥
  • Create 4096 RSA Key with Puttygen GUI

    使用Puttygen GUI创建4096个RSA密钥
  • Create 4096 DSA Key with Puttygen GUI

    使用Puttygen GUI创建4096个DSA密钥

将现有密钥加载到Puttygen GUI(Load Existing Key To Puttygen GUI)

We can load existing puttygen generated key or key pairs easily. We will use the Load button where we can specify the key file.

我们可以轻松加载现有的puttygen生成的密钥或密钥对。 我们将使用“ Load按钮来指定密钥文件。

Load Existing Key To Puttygen GUI
Load Existing Key To Puttygen GUI
将现有密钥加载到Puttygen GUI

将生成的公钥保存到文件 (Save Generated Public Key To A File)

After creating a Public and Private Key Pair we can save these created keys. We can save generated Public Key into a file with the Save public key.

创建公钥和私钥对后,我们可以保存这些创建的密钥。 我们可以使用Save public key将生成的Public Key保存到文件中。

Save Generated Public Key To A File
Save Generated Public Key To A File
将生成的公钥保存到文件

将生成的私钥保存到文件(Save Generated Private Key To A File)

We can also save the generated Private Key into the file with the Save private key button like below.

我们还可以使用“ Save private key按钮将生成的私钥保存到文件中,如下所示。

Save Generated Private Key To A File
Save Generated Private Key To A File
将生成的私钥保存到文件

从命令行使用默认选项创建密钥(Create Key with Default Options From Command Line)

We can generate keys with the following command. In this example, we will generate an RSA type key file named test.ppk . ppk is the extension of the putty keys.

我们可以使用以下命令生成密钥。 在此示例中,我们将生成一个名为test.ppk的RSA类型密钥文件。 ppk是油灰键的扩展名。

$ puttygen -t rsa -o test.ppk

从命令行设置密钥大小 (Set Key Size From Command Line)

We have the option to set the size of the putty key. More in size means more secure but less performance. But the performance loss is negligible. We can set the size with -b option. We will provide size as a bit unit. In this example, we will set the key file size 4096 bit .

我们可以选择设置油灰键的大小。 更大的尺寸意味着更安全,但性能更低。 但是性能损失可以忽略不计。 我们可以使用-b选项设置大小。 我们将以位为单位提供尺寸。 在此示例中,我们将设置密钥文件大小4096 bit。

$ puttygen -t rsa -b 4096 -o test.ppk

从命令行更改密码 (Change Passphrase From Command Line)

Keys are protected with symmetric encryption. This means ppk keys are encrypted and we need to use a passphrase. We can also change the current passphrase with -P option. In order to change the existing passphrase, we should provide old passphrases too.

密钥受对称加密保护。 这意味着ppk密钥已加密,我们需要使用密码短语。 我们还可以使用-P选项更改当前密码。 为了更改现有的密码短语,我们也应该提供旧的密码短语。

$ puttygen mykey.ppk -P

从命令行设置注释为键 (Set Comment To Key From Command Line)

In the enterprise environment, we may have multiple keys where we cannot remember actually what it was. Or we may need to put some comment about keys on the key file. We can use –C and the comment we want to set.

在企业环境中,我们可能有多个键,我们无法真正记住它是什么。 或者,我们可能需要在密钥文件上对密钥进行一些评论。 我们可以使用– C和我们要设置的注释。

$ puttygen mykey.ppk -C "My key"

翻译自: https://www.poftut.com/generate-putty-keys-wit-puttygen/

puttygen生成公私钥

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值