ssh认证概念问题

发布于 2024-12-06 17:36:14 字数 243 浏览 0 评论 0原文

我在任何地方读到他们都说 ssh 密钥对身份验证比简单的密码身份验证更安全,因为发送到服务器的签名总是不同的。因此,如果有人得到我的签名,他下次就无法使用它代表我登录。

现在我的问题是这个签名有何独特之处?

服务器是否首先发送一些随机字符串,让我的计算机用我的私钥对其进行签名,然后将其发回。因为这是我每次都认为签名是唯一的唯一方法。但在网络上的任何地方,他们都说客户端首先发送签名(因为这是第一步),但我认为服务器应该首先发送随机字符串!

Everywhere I read they say ssh key pair authentication is more secure then simple password authentication because signature send to the server is always different . So if someone get my signature he cannot use it next time to login on my behalf .

Now my question is how this signature is unique ?

Does server send some random string first to which my computer sign it with my private key and send it back . Because this is the only way I see signature to be unique everytime . But everywhere on the web they say client send signature FIRST (as this is the first step) but I think server should send random string first !!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤千羽 2024-12-13 17:36:14

对于密钥身份验证,您的私钥永远不会透露给服务器(因此也不会透露给攻击者),只会透露您的公钥。同样,服务器的私钥永远不会透露给您(或攻击者),只有公钥。

Diffie-Hellman 用于派生两个密钥对(双方各一个)然后用于来回发送应用程序数据,无论身份验证是使用简单密码还是使用公钥身份验证完成。

密码身份验证的情况下,在用户/密码通过网络发送之前计算会话密钥对。金属丝。这可以防止简单的窃听,但当然不能防止攻击者尝试直接连接并猜测用户/密码组合。当然,许多用户选择了较差的密码

公钥身份验证的情况下,计算会话密钥对,然后进行简单的对话(通常是数学问题/答案)是使用 RSA 或类似算法来验证声明的用户与公钥。如果不猜测其中一个私钥,就无法伪造此对话。如果正确完成,这比即使是最强的密码也更难做到。即使公钥身份验证存在弱点,例如在随机数生成器中,由此产生的弱公钥身份验证仍然比密码身份验证强得多。

For key authentication, your private key is never revealed to the server (and therefore not to the attacker), only your public key. Likewise, the server's private key is never revealed to you (or the attacker), only the public key.

Diffie-Hellman is used to derive two keypairs (one for each party) that are then used to send application data back and forth, whether authentication is done using a simple password or using public-key authentication.

In the case of password authentication, the session keypairs are calculated before the user/password is sent across the wire. This prevents simple eavesdropping but of course does not prevent attackers from trying to connect and guess the user/password combination directly. And of course, many users choose poor passwords.

In the case of public-key authentication, the session keypairs are calculated, then a simple conversation (typically a math question/answer) is done using RSA or a similar algorithm to verify the declared user matches the public key. This conversation cannot be faked without guessing one of the private keys. When done correctly, this is much harder to do than for even the strongest passwords. Even if there is a weakness in public-key authentication, such as in the random number generator, the resulting weak public-key authentication can still be much stronger than for password authentication.

锦上情书 2024-12-13 17:36:14

我不是安全专家,但这是我对基于密钥的身份验证如何工作的理解:服务器发送使用您的私钥加密的随机数。客户端解密质询并将其发送回服务器,验证其是否拥有私钥。

但是,我认为基于密码的身份验证使用了类似的技术:服务器发送一个随机数。客户端将随机数附加到密码中,计算哈希值,并将其发送到服务器,服务器通过以相同的方式计算哈希值来验证它。

因此,这似乎并不是基于公钥的身份验证“更安全”的原因。

I’m not a security expert, but here’s my understanding of how key-based authentication works: The server sends a random number encrypted using your private key. The client decrypts the challenge and sends it back to the server, verifying that it is in possession of the private key.

However, I presume that a similar technique is used for password-based authentication: The server sends a random number. The client appends the random number to the password, computes the hash, and sends it to the server which verifies it by computing it in the same way.

So that doesn’t seem to be a reason why public key–based authentication would be “more secure”.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文