c# - How to resolve a 'Bad packet length' error in SSH.NET? -
i'm trying upload files via sftp, using ssh.net. sftpclient.connect() throws sshconnectionexception message, "bad packet length 1302334341." code:
static void main() { try { sftpclient sftp = new sftpclient(server, 22, userid, password); sftp.connect(); } catch(exception e) { console.writeline(e.message); } } i saw in discussion has encryption. i'm using aes, , have host key. don't understand how enter encryption, though. based on discussion, playing this:
connectioninfo connectioninfo = new passwordconnectioninfo(server, 22, userid, password); connectioninfo.encryptions.clear(); connectioninfo.encryptions.add("aes","ssh-rsa 2048 11:22:34:d4:56:d6:78:90:01:22:6b:46:34:54:55:8a") i know that's not right set of arguments pass encryptions.add(), i'm little lost using library; can me figure out how set encryption (assuming that's problem)?
solved, in this discussion. needed remove encryptions using
foreach (var d in connectioninfo.encryptions.where(p => p.key != "aes128-cbc").tolist()) { connectioninfo.encryptions.remove(d.key); } substituting in whichever encryption intend use
Comments
Post a Comment