Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
Created November 28, 2014 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxfight3r/593f35f297f8b619a470 to your computer and use it in GitHub Desktop.
Save tuxfight3r/593f35f297f8b619a470 to your computer and use it in GitHub Desktop.
openssh proxy tricks
METHOD 1: (with nc in localbox)
ssh -D 60002 mohan@10.1.1.20
sftp -o 'ProxyCommand=nc -xlocalhost:60002 %h %p' USER@remotehost.com
METHOD 2: (with nc in remote box)
sftp -o 'ProxyCommand ssh -q -l mohan 10.1.1.20 nc remotehost.com 22' USER@remotehost.com
METHOD 3: (without nc at all)
ssh -L 60002:remotehost.com:22 mohan@10.1.1.20
sftp -o Port=60002 USER@localhost
more: http://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment