3 ms·
If SCP/SFTP is not an option and you've got netcat installed on the target you can definitely perform some magic. now of course this does require you to log in
by Tsiklon 7y ago
If SCP/SFTP is not an option and you've got netcat installed on the target you can definitely perform some magic. now of course this does require you to log in on the destination though
~~ Receiving system
`# nc -l -p $arbitraryPort > /path/to/file `
~~ Sending system
`# cat /path/to/file | nc $receivingSystemIP -p $arbitraryPort `
eg:
`# nc -l -p 9669 > /home/user/staging/httpd.conf `
`# cat /etc/httpd/httpd.conf | nc 10.50.50.1 -p 9669 `
This method is a useful feather to have in one's cap when used in combination with tar and Pipeviewer `pv`.
I've used this several times doing a backup of a large database and when I don't have enough space locally to hold the copy.
- johnisgood 7y agoNote: you can do the opposite as well to achieve the same thing, e.g. listen on the "sending system", in which case when you connect, you get the file.