JSchException: Algorithm negotiation fail

前端 未结 10 1937
面向向阳花
面向向阳花 2020-11-27 06:30

I am trying to connect to remote sftp server over ssh with JSch (0.1.44-1) but during \"session.connect();\" I am getting this exception:

com.jcraft.jsch.JS         


        
10条回答
  •  难免孤独
    2020-11-27 06:52

    The complete steps to add the algorithms to the RECEIVING server (the one you are connecting to). I'm assuming this is a Linux server.

    sudo /etc/ssh/sshd_config
    

    Add this to the file (it can be at the end):

    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-group-exchange-sha1,diffie-hellman-group1-sha1
    

    Then restart the SSH server:

    sudo service sshd restart
    

提交回复
热议问题