Skip to content

Instantly share code, notes, and snippets.

@ramn
Created September 27, 2012 14:27
Show Gist options
  • Save ramn/3794292 to your computer and use it in GitHub Desktop.
Save ramn/3794292 to your computer and use it in GitHub Desktop.
Send a file with netcat over ssh tunnel
### Sending a file
# BSD nc syntax
cat myDocument.pdf | ssh me.myserver.com nc -l 20000
# Hobbit nc syntax - try this one if unsure!
cat myDocument.pdf | ssh me.myserver.com nc -l -p 20000
### Receiving a file
nc me.myserver.com 20000 > myDocument.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment