Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if I use scp from same network with python paramiko #258

Open
q000p opened this issue Nov 12, 2023 · 3 comments
Open

Error if I use scp from same network with python paramiko #258

q000p opened this issue Nov 12, 2023 · 3 comments

Comments

@q000p
Copy link

q000p commented Nov 12, 2023

If I run python script with scp from dropbear host from same subnet (without gateway) I have error Channel closed. If I use gateway or if I use v2020.79 of dropbear, the problem is absent.
Paramiko log attached
paramerror.log

@q000p
Copy link
Author

q000p commented Nov 13, 2023

Logs from dropbear:
root@Decode:~# dropbear -F -E [18096] Nov 13 14:48:32 Failed loading /etc/dropbear/dropbear_rsa_host_key [18096] Nov 13 14:48:32 Failed loading /etc/dropbear/dropbear_dss_host_key [18096] Nov 13 14:48:32 Not backgrounding [18111] Nov 13 14:48:36 Child connection from 192.168.221.120:45278 [18111] Nov 13 14:48:44 Password auth succeeded for 'root' from 192.168.221.120:45278 [18111] Nov 13 14:48:45 Exit (root) from <192.168.221.120:45278>: Failed assertion (common-channel.c:705): `!channel->sent_close' [18096] Nov 13 14:53:19 Early exit: Terminated by signal

@mkj
Copy link
Owner

mkj commented Nov 13, 2023

Thanks for the Dropbear log, I'll have a look (might be a bit delayed)

@richardash1981
Copy link

I'm having similar issues to this and/or #220:

  • Local (switched gigabit ethernet) connection between PC running Python/Paramiko client and embedded dropbear server.
  • Paramiko receives (somewhat at random) "Channel closed" exceptions - paramiko.ssh_exception.SSHException: Channel closed.
  • Paramiko is being used to establish one session, and then run a succession of exec_command commands via channels. Usually the first few (the number varies) of these succeed, then a subsequent one fails with the above exception (at which point the session is closed).

Dropbear logs are very weird. When there is an exception, dropbear logs:

Oct  1 13:17:46 EA_VNH1 authpriv.info dropbear[8384]: Child connection from 192.168.0.153:33520
Oct  1 13:17:47 EA_VNH1 authpriv.notice dropbear[8384]: Pubkey auth succeeded for 'root' with ssh-rsa key SHA256:JbHcJycuOViQaJdGr7WPrKR1clJqC6ypWAd0UTcPvZs from 192.168.0.153:33520
Oct  1 13:17:47 EA_VNH1 authpriv.info dropbear[8384]: Exit (root) from <192.168.0.153:33520>: Exited normally

OK, but on the rare case where the script completes without an error (all the commands succeed), the dropbear logs are:

Oct  1 13:17:57 EA_VNH1 authpriv.info dropbear[8435]: Child connection from 192.168.0.153:46340
Oct  1 13:17:57 EA_VNH1 authpriv.notice dropbear[8435]: Pubkey auth succeeded for 'root' with ssh-rsa key SHA256:JbHcJycuOViQaJdGr7WPrKR1clJqC6ypWAd0UTcPvZs from 192.168.0.153:46340
Oct  1 13:17:58 EA_VNH1 authpriv.info dropbear[8435]: Exit (root) from <192.168.0.153:46340>: Error reading: Connection reset by peer

The errors seem to be inverted (I did check order and timings, and get lots more failed runs than successful ones).

Versions:
paramiko==3.5.0 from pip
Python 3.12.3 on x86_64 Linux.
dropbear-2022.83 from buildroot 2023.02.6 on arm32v7l

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants