【问题标题】:Cannot connect to openssh using otp ssh module无法使用 otp ssh 模块连接到 openssh
【发布时间】:2015-09-20 12:48:48
【问题描述】:

我正在尝试使用 erlang ssh 模块连接到 openssh(版本:SSH-2.0-OpenSSH_6.7p1 Debian-6)服务器。 OpenSSH 服务器使用默认配置

执行以下操作:

ssh:connect(Server, 22, [MyFancyOptions])

给予:

Selection of key exchange algorithm failed

确实,通过看Wireshark我看到了erlang客户端提出的密钥交换算法:

diffie-hellman-group1-sha1

和服务器:

curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

不匹配...

问题: 有什么办法可以连接到erlang中的ssh服务器吗?

PS。是的,我看到了

%% TODO: diffie-hellman-group14-sha1 should also be supported.
%% Maybe check more things ...
verify_algorithm(#alg{kex = 'diffie-hellman-group1-sha1'}) ->

但是不要告诉我神圣的 Erlang 不能处理现代的 ssh...

【问题讨论】:

    标签: ssh erlang openssh erlang-otp


    【解决方案1】:

    是的,您似乎需要扩充您的服务器以提供额外的 KexAlgorithms,例如:

    KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie- hellman-group1-sha1

    但是...完成此操作后,我没有成功做任何有用的事情。我在日志中看到一个错误:

    sshd[8026]: dispatch_protocol_error: type 30 seq 7

    看来 Erlang ssh 模块与现代 ssh 存在一些重大问题...

    【讨论】:

      【解决方案2】:

      如果您在 /etc/ssh/sshd_config 中将 openssh 配置为 openssh6.0 默认值,则 OTP 15 中的 Erlang ssh 客户端将与 openssh-6.7 服务器一起使用,如下所示:

      Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour
      KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
      

      Erlang ssh 客户端仅支持密码 aes128-cbc,3des-cbc,这些密码在 openssh-6.7 中默认未启用,至少在 Debian openssh 包中未启用。

      【讨论】:

        猜你喜欢
        • 2020-03-10
        • 2020-12-01
        • 2019-03-09
        • 1970-01-01
        • 2021-06-08
        • 2021-07-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多