How to debug ssh issues?

I’ve been having ssh issues as documented here: Running a command with sudo after sshing into any user causes the ssh session to hang · Issue #70418 · NixOS/nixpkgs · GitHub and I’ve reached the point where I’m out of ideas.

Effectively, sshing into my nixos box after a fresh boot works until any program is run, including cat. Once a program is run the session freezes before the program can execute and pkill ssh is needed on the ssh client machine (Tested on both Arch and Fedora) since ctl-c won’t exit the hung session. Once this occurs every subsequent attempt to ssh in hands after asking for a password and a server reboot is needed to get the connection that freezes when running programs.
Running ssh after the initial hang with ssh -vvv xxx@yyy freezes at:
“debug2: channel 0: open confirm rwindow 0 rmax 32768”

I’ve tried looking through various wiki pages, stack exchange sites and mailing lists and have tried adding AllowUsers liam and allowDNS but neither make a difference.

Logs for the ssh server give no errors, final output is notifying the ssh session pid.

So pretty much I’m wondering, has anyone dealt like anything like this before? Does anyone have any other ideas for debugging ssh/d? I’ve never had ssh issues before, with Nixos and other distros, so I just have no clue where else to look.

After reading this post I’ve worked out the solution is the change wifi drivers from b43 to the default wl. Kinda annoying as I find wl to have much worse performance and stability but at least I can ssh in now.

From what I understand, they disable the ‚wl‘ driver to fix the issue in the first few comments. The later comment #23 suggests to disable vlan with
sudo iwpriv eth1 set_vlanmode 0

Idk if iwpriv still works, I‘m on phone right now and can‘t test it.
But if it does on the b43, it might make sense to fix it in the package…