GNU/Linux >> Linux の 問題 >  >> Cent OS

CentOS/RHEL 8 の SSH サービスで弱い暗号と安全でない HMAC アルゴリズムを無効にする方法

質問 :CentOS/RHEL 8 の SSH サービスで弱い暗号と安全でない HMAC アルゴリズムを無効にする方法は?

CentOS/RHEL 8 の ssh サービスで脆弱な暗号と安全でない HMAC アルゴリズムを無効にするには、以下の手順に従ってください:

1. /etc/sysconfig/sshd を編集します CRYPTO_POLICY 行のコメントを外します:

前:

# CRYPTO_POLICY=[Original value]

後:

CRYPTO_POLICY=[New value]

2. 正しい暗号、MAC、および KexAlgorithms が /etc/ssh/sshd_config ファイルに追加されていることを確認してください。

KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com

3. sshd サービスを再起動します:

# systemctl restart sshd

4. 脆弱な CBC 暗号が有効になっているかどうかをテストするには、次のコマンドを実行します:

# ssh -vv -oCiphers=3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc [@IP of your Server]

成功すると、パスワードの入力を求められます。これは、弱い暗号が有効になっていることを意味します。

失敗した場合は、次のようなメッセージが表示されます:

Unable to negotiate with  port 22: no matching cipher found. Their offer: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr

これは、軽減策が適切に機能していることを意味します。

5. 弱い HMAC アルゴリズムが有効になっているかどうかをテストするには、次のコマンドを実行します:

# ssh -vv -oMACs=hmac-md5,hmac-md5-96,hmac-sha1,hmac-sha1-96,hmac-md5-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha1-96-etm@openssh.com,umac-64-etm@openssh.com [@IP of your Server]
CentOS/RHEL 6 および 7 の SSH サービスで脆弱な暗号と安全でない HMAC アルゴリズムを無効にする方法


Cent OS
  1. CentOS / RHEL 7 で NetworkManager を無効にする方法

  2. CentOS / RHEL 6,7 で NUMA を無効にする方法

  3. CentOS / RHEL 7でfirewalldを無効にしてiptablesに切り替える方法

  1. CentOS/RHEL 7 で FIPS モードを無効にする方法

  2. CentOS/RHEL 7 で os-prober を無効にする方法

  3. CentOS/RHEL 6 および 7 で rpc.quotad サービスを無効にする方法

  1. CentOS / RHEL 7 で IPv6 を無効にする方法

  2. CentOS / RHEL 7 :すべての tty コンソールを無効にして 1 つだけ有効にする方法

  3. CentOS/RHEL 6 および 7 の SSH サービスで弱い暗号と安全でない HMAC アルゴリズムを無効にする方法