netcat common usage

do you have several servers?
do you transfer data between them?

time to time I transfer data between servers and in most cases I use

scp local-file user@host:/path/remote-file

to send file or
scp user@host:/path/remove-file

to receive

for this task netcat is useful too, so it can be like this
server side

nc -l -p 12121 > local-file

and at client site I just need to
cat local-file | nc host 12121

of course 12121 need to be replaced with something random because "nc" don't provide authentication and encryption

Tags:
Links:

FreeBSD's sockstat Linux(debian)

Many years I used FreeBSD as my server invioroment, but before 6 months I migrate to Debian Linux, because I have no time to compile packages from sources.

So, now I work with Debian and I am newbie. Common action when some network application don't work is to review opened ports. FreeBSD have very good utility sockstat. I don't found something like this in Debian and I googled, as result I discover next alternatives for sockstat:

  • lsof -i
  • netstat -anpe

in this example netstat don't show fd+uid, but for this socklist can used

Tags:
Links: