1

every time that I'll send a thing from computer A to computer B with nc, I to use these commands,

Computer A

tar cfp - film.mp4 | nc -w 3 192.168.xxx.xx 1234

Computer B

nc -l -p 1234 | tar xvfp -

My question, I have openssh, how can send mine videos, file, directories,.. with ssh and nc, without to used other programmes like rsync, tar, sftp,...

Very thanks for your recommendations!

3
  • 1
    Just use scp directly? Commented Jan 20, 2020 at 10:59
  • Thanks for your answer!, what as here OpenSSH 8.0 says openssh.com/txt/release-8.0 , The scp protocol is outdated, inflexible and not readily fixed. We recommend the use of more modern protocols like sftp and rsync for file transfer instead. Commented Jan 20, 2020 at 11:07
  • 1
    It will still work for most purposes. If you don't want to use it, then use sftp, which is part of OpenSSH. I really don't see any use for nc here when SSH is being used. Commented Jan 20, 2020 at 11:08

1 Answer 1

3

@muru's comment is very valid, but for the sake of academical purpose:

Computer A:

cat source | ssh user@ComputerB 'cat > destination'

(Assumes password-less authentication by public key.)

2
  • I have on both computer to write sudo service ssh restart Commented Jan 20, 2020 at 11:40
  • sorryyyy, I write on [email protected] my hostname, when i should to write my username.... Veryyy thanks! , I wish your a nice Day! Commented Jan 20, 2020 at 12:48

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.