Specify key exchange protocol with lftp

0

I have to download some (large) data from a distant server.

The remote IT people suggest using lftp sftp://user@server.domain:port.

However, when I type ls, I read:

`ls' at 0 [Unable to negotiate with XXX.XXX.XXX.XXX port PPP: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1]

It seems that they cannot change their key exchange method now (yes, I know, it is subject to attack, I warned them).

So I used:

sftp -P port -o KexAlgorithms=+diffie-hellman-group1-sha1 user@server.domain

I type get -a -r *, but I now have problem with symlinks, which are poorly handled by sftp (as far as I know).

What are my options now?

user980053

Posted 2020-02-18T10:07:19.387

Reputation: 73

Answers

1

Both lftp and sftp use /usr/bin/ssh as the transport – they let the SSH client establish the connection (starting the SFTP responder instead of an interactive shell) and only speak the SFTP protocol over stdin/stdout. Many other programs such as GVFS, rsync, Git, Borg, etc. also work the same way.

You can use ~/.ssh/config to specify custom settings that apply to all programs which invoke 'ssh':

Host server.domain
    KexAlgorithms +diffie-hellman-group1-sha1

user1686

Posted 2020-02-18T10:07:19.387

Reputation: 283 655

Tested. Works like a charm. – user980053 – 2020-02-18T10:43:20.237