Skip to content

SSH pipe not closed when receiving side closes #379

@ghewson

Description

@ghewson

The command

ssh root@openwrt "tcpdump -i lan0 -U -w -" | wireshark -k -i -

as described here:

https://openwrt.org/docs/guide-user/firewall/misc/tcpdump_wireshark

allows viewing of network traffic on the OpenWrt host from another host. The command works, but when Wireshark is closed the pipe stalls and the tcpdump command must be killed manually.

This is using OpenWrt 24.10.2 with Dropbear server v2024.86 and an OpenSSH client.

A minimal test case is:

ssh user@host "cat /dev/zero" |false

as described here:

https://unix.stackexchange.com/questions/161690/terminating-ssh-called-from-a-script-sigpipe-handling

The command hangs when connecting to OpenWrt running Dropbear, but terminates normally when connecting to a server running OpenSSH.

I've also reproduced the problem by running the test case against an Ubuntu machine which has the dropbear package installed, running Dropbear server version 2022.83-4. Again, if OpenSSH server version 9.9 is installed instead, the test command terminates normally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions