GNU/Linux >> Linux の 問題 >  >> Linux

AES-256-CBC で SSH ペアを生成する

しない aes で使用されるキーを生成します ssh-keygen を使用する場合 . aes以降 対称暗号です 、そのキーはしません ペアで来てください。通信の両端で同じキーを使用します。

ssh-keygen によって生成された鍵は、認証に公開鍵暗号を使用します。 ssh-keygen から マニュアル:

 ssh-keygen generates, manages and converts authentication keys for
 ssh(1).  ssh-keygen can create RSA keys for use by SSH protocol version 1
 and DSA, ECDSA, Ed25519 or RSA keys for use by SSH protocol version 2.

ssh から マニュアル:

 Public key authentication works as follows: The scheme is based on
 public-key cryptography, using cryptosystems where encryption and
 decryption are done using separate keys, and it is unfeasible to derive
 the decryption key from the encryption key.  The idea is that each user
 creates a public/private key pair for authentication purposes.  The
 server knows the public key, and only the user knows the private key.
 ssh implements public key authentication protocol automatically, using
 one of the DSA, ECDSA, Ed25519 or RSA algorithms.

公開鍵暗号化の問題は、非常に遅いことです。対称鍵暗号方式ははるかに高速で、ssh で使用されています 実際のデータ転送用。対称暗号化に使用される鍵は、接続が確立された後にオンザフライで生成されます (sshd から引用) マニュアル):

 For protocol 2, forward security is provided through a Diffie-Hellman key
 agreement.  This key agreement results in a shared session key.  The rest
 of the session is encrypted using a symmetric cipher, currently 128-bit
 AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES.  The
 client selects the encryption algorithm to use from those offered by the
 server.  Additionally, session integrity is provided through a
 cryptographic message authentication code (hmac-md5, hmac-sha1, umac-64,
 umac-128, hmac-ripemd160, hmac-sha2-256 or hmac-sha2-512).

aes256-cbc を使用する場合 -c オプションを使用してコマンド ラインで指定する必要があります。最も基本的な形式では、次のようになります。

$ ssh -c aes256-cbc [email protected]

ssh_config で暗号の優先選択を指定することもできます 、カンマ区切りのリストを使用。ただし、これは専門家に任せるのが最善であるため、デフォルトをいじることはお勧めしません。 OpenSSH 開発者によるデフォルトの選択には、多くの考慮事項と長年の経験があります。


Linux
  1. Ssh –公開鍵認証を使用したSshでパスワードプロンプトを引き続き取得しますか?

  2. マルチホップSshトンネルでSsh-copy-idを使用する方法は?

  3. LinuxでSSHを使い始める

  1. PleskでSSHキーを使用する方法

  2. LinuxでSSHキーを生成するコマンド

  3. OpenSSLを使用して証明書署名要求(CSR)を生成する方法は?

  1. SeahorseでSSHキーをグラフィカルに管理する

  2. SSHキーペアを生成する方法(例付き)

  3. SSH –sshキーの生成と操作