Better HN
topnewbestaskshowjobs
Log inSign up

dramaturg

1 karma · joined Mar 30, 2015 (11y ago) · 2 submissions

Submissions

comment 10y ago · link · parent

+1 for RSS

comment 11y ago · link · parent

I once made the following while drunk a few years back. It was a nerd-dare...

  # dark magicks for hopping hosts. first version
  # (you'll need to specify target user name though)
  Host *+*
        VerifyHostKeyDNS=no
        ProxyCommand	ssh $(echo %h | sed 's/^\([^+]*\).*$/\1/') nc $(sed -n '/^Host[ \t]*\('$(echo %h | sed 's/^.*+\([^+]*\)$/\1/')'\)$/,/^$/{/^.*HostName[ \t]*/{s///; s/[ \t]*$//; h}}; ${x; /./{p; b}; s/^/'$(echo %h | sed 's/^.*+\([^+]*\)$/\1/')'/p}' ~/.ssh/config) $(sed -n '/^Host[ \t]*\('$(echo %h | sed 's/^.*+\([^+]*\)$/\1/')'\)$/,/^$/{/^.*Port[^0-9]*/{s///;s/[ \t]*$//;h;};};${x;/./{p;q;};s/^/22/p;}' ~/.ssh/config)