信息安全:了解 OpenSSH 中的各种算法选项

13 篇文章 0 订阅
6 篇文章 0 订阅

在这里插入图片描述

在系统中, ssh -Q help 命令的参数,用于列出 OpenSSH 中支持的各种加密和验证算法。以下是每个选项的详细说明:

PS C:\Users\heish> ssh -Q help
cipher
cipher-auth
compression
kex
key
key-cert
key-plain
key-sig
mac
protocol-version
sig

1. cipher

列出支持的加密算法(对称加密算法)。这些算法用于加密 SSH 会话中的数据。

PS C:\Users\heish> ssh -Q cipher                                                                                        
3des-cbc                                                                                                                
aes128-cbc                                                                                                              
aes192-cbc                                                                                                              
aes256-cbc                                                                                                              
aes128-ctr                                                                                                              
aes192-ctr                                                                                                              
aes256-ctr                                                                                                              
aes128-gcm@openssh.com                                                                                                  
aes256-gcm@openssh.com                                                                                                  
chacha20-poly1305@openssh.com

常见的加密算法包括:

  • aes128-ctr
  • aes192-ctr
  • aes256-ctr
  • chacha20-poly1305@openssh.com

2. cipher-auth

列出支持的同时提供机密性和认证功能的加密算法。

PS C:\Users\heish> ssh -Q cipher-auth
aes128-gcm@openssh.com
aes256-gcm@openssh.com
chacha20-poly1305@openssh.com

常见的算法包括:

  • aes128-gcm@openssh.com
  • aes256-gcm@openssh.com

3. kex

列出支持的密钥交换算法。这些算法用于在 SSH 连接建立时安全地交换加密密钥。

PS C:\Users\heish> ssh -Q kex
diffie-hellman-group1-sha1
diffie-hellman-group14-sha1
diffie-hellman-group14-sha256
diffie-hellman-group16-sha512
diffie-hellman-group18-sha512
diffie-hellman-group-exchange-sha1
diffie-hellman-group-exchange-sha256
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521
curve25519-sha256
curve25519-sha256@libssh.org

常见的密钥交换算法包括:

  • curve25519-sha256
  • ecdh-sha2-nistp256
  • diffie-hellman-group14-sha256

4. kex-gss

列出支持的基于 GSSAPI 的密钥交换算法。这些算法用于在支持 GSSAPI 的环境中进行密钥交换。

ssh -Q kex-gss

5. key

列出支持的公钥加密算法。这些算法用于生成和验证 SSH 公钥。

PS C:\Users\heish> ssh -Q key
ssh-ed25519
ssh-ed25519-cert-v01@openssh.com
sk-ssh-ed25519@openssh.com
sk-ssh-ed25519-cert-v01@openssh.com
ssh-rsa
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
sk-ecdsa-sha2-nistp256@openssh.com
ssh-rsa-cert-v01@openssh.com
ssh-dss-cert-v01@openssh.com
ecdsa-sha2-nistp256-cert-v01@openssh.com
ecdsa-sha2-nistp384-cert-v01@openssh.com
ecdsa-sha2-nistp521-cert-v01@openssh.com
sk-ecdsa-sha2-nistp256-cert-v01@openssh.com

常见的公钥算法包括:

  • ssh-ed25519
  • ecdsa-sha2-nistp256
  • rsa-sha2-256

6. key-cert

列出支持的证书密钥类型。这些用于基于证书的认证。

PS C:\Users\heish> ssh -Q key-cert
ssh-ed25519-cert-v01@openssh.com
sk-ssh-ed25519-cert-v01@openssh.com
ssh-rsa-cert-v01@openssh.com
ssh-dss-cert-v01@openssh.com
ecdsa-sha2-nistp256-cert-v01@openssh.com
ecdsa-sha2-nistp384-cert-v01@openssh.com
ecdsa-sha2-nistp521-cert-v01@openssh.com
sk-ecdsa-sha2-nistp256-cert-v01@openssh.com

常见的证书密钥类型包括:

  • ssh-rsa-cert-v01@openssh.com
  • ecdsa-sha2-nistp256-cert-v01@openssh.com
  • ssh-ed25519-cert-v01@openssh.com

7. key-plain

列出支持的非证书公钥类型。

PS C:\Users\heish> ssh -Q key-plain
ssh-ed25519
sk-ssh-ed25519@openssh.com
ssh-rsa
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
sk-ecdsa-sha2-nistp256@openssh.com

8. mac

列出支持的消息认证码(MAC)算法。这些算法用于确保数据的完整性和真实性。

PS C:\Users\heish> ssh -Q mac
hmac-sha1
hmac-sha1-96
hmac-sha2-256
hmac-sha2-512
hmac-md5
hmac-md5-96
umac-64@openssh.com
umac-128@openssh.com
hmac-sha1-etm@openssh.com
hmac-sha1-96-etm@openssh.com
hmac-sha2-256-etm@openssh.com
hmac-sha2-512-etm@openssh.com
hmac-md5-etm@openssh.com
hmac-md5-96-etm@openssh.com
umac-64-etm@openssh.com
umac-128-etm@openssh.com

常见的 MAC 算法包括:

  • hmac-sha2-256
  • hmac-sha2-512
  • umac-128-etm@openssh.com

9. protocol-version

列出支持的 SSH 协议版本。

ssh -Q protocol-version

常见的版本包括:

  • 2(SSH-2)

10. sig

列出支持的签名算法。这些算法用于生成和验证数字签名。

PS C:\Users\heish> ssh -Q sig
ssh-ed25519
sk-ssh-ed25519@openssh.com
ssh-rsa
rsa-sha2-256
rsa-sha2-512
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
sk-ecdsa-sha2-nistp256@openssh.com
webauthn-sk-ecdsa-sha2-nistp256@openssh.com

常见的签名算法包括:

  • rsa-sha2-256
  • rsa-sha2-512
  • ecdsa-sha2-nistp256
  • ssh-ed25519

结论

通过使用 ssh -Q 命令和不同的选项,可以查看 OpenSSH 支持的各种加密、验证和密钥交换算法。这些选项帮助用户了解当前系统的安全配置,并根据需要进行调整以增强安全性。

  • 17
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

运维开发王义杰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值