[Bug 3801] Expand TOKENS available in ProxyCommand to support port forwarding
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Wed Mar 12 15:24:07 AEDT 2025
https://bugzilla.mindrot.org/show_bug.cgi?id=3801
--- Comment #2 from Darren Tucker <dtucker at dtucker.net> ---
It's a bit icky, but given you specified you're running on Linux, the
ProxyCommand can fish the parent ssh's command line out of
/proc/$PPID/cmdline and do whatever it likes with it, eg:
$ cat proxycommand
#!/bin/sh
cmdline=$(xargs -0 </proc/$PPID/cmdline)
echo "Parent Command line: $cmdline" >&2
exec nc $1 $2
$chmod a+x proxycommand
$ ssh -o proxycommand='./proxycommand %h %p' localhost
Parent Command line: ssh -o proxycommand=./proxycommand %h %p localhost
Last login: Wed Mar 12 15:18:15 2025 from 127.0.0.1
[etc]
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
More information about the openssh-bugs
mailing list