in reply to Net::OpenSSH channel_post_mux_listener getpeereid failed: Operation not supported [RESOLVED]

While I can't pinpoint anything specific, you can find out more about where exactly things go sideways by enabling debugging in Net::OpenSSH:

$Net::OpenSSH::debug = ~0;

turns on all debug information, but I think you'll be most interested in what the documentation calls bit 4 ("connecting") and bit 64 ("IO loop"). I would call these bits "bit 3" and "bit 7", but having them as numbers suggests the following line:

$Net::OpenSSH::debug = 4+64; # connection and IO loop

A random Google search for the error message and WSL suggests that maybe WSL doesn't allow fetching the peer user information, or maybe that the wrong SSH command (maybe ssh.exe ?) gets launched. This feels like a really long shot but should be easily verified (or rather, discarded) if you look at the output of

$Net::OpenSSH::debug = 8+16; # commands and execution

Replies are listed 'Best First'.
Re^2: Net::OpenSSH channel_post_mux_listener getpeereid failed: Operation not supported
by kbro (Novice) on Feb 15, 2022 at 14:23 UTC

    The debug did the trick, thanks!

    I set it to ~0 to get EVERYTHING and noticed the ctl_dir and ctl_path values were pointing into my home directory, which on WSL1 is /mnt/c/Users/kevinb - a drvfs mount of my Windows C: drive. I remembered TROUBLESHOOTING 6 in the POD page saying Some file systems (as for instance FAT or AFS) do not support placing sockets inside them and guessed that maybe NTFS was on the Naughty List as well.

    I created a /tmp/kevinb directory (which df tells me is rootfs), chmod'ed it to 0700 for good measure and added ctl_dir=>"/tmp/kevinb" to the Net::OpenSSH->new constructor call. Hey, presto - the getpeerid not supported error went away and my script started working.

    Thanks for pointing me in the right direction!

      Hahaha... You know, I added the troubleshooting section to the module documentation in 2009, thirteen years ago and, as far as I can remember, this is the first time I have heard of somebody that had read it or/and found it useful!

      You made my day :-)

        If I'd kept on reading I'd've found the section on DEBUGGING and wouldn't've needed the hint :-)

        That's why you should never add useful documentation: people who read it will never need to contact you, so you'll never get to discover that it's useful or even that it has been read. If you want to meet interesting new people, you need to write bad or misleading docs - then they'll contact you of their own accord.