File Transfer Using linux nc commands

Source: Internet
Author: User

I will not describe how to use the linux nc command to transfer files. Today I will focus on using nc to transfer files. The reason is that the company's device sudo does not have ssh, scp, or other remote access commands, or the host. deny contains ssh deny. Today, I used scp to illustrate the next more useful lightweight tool, another powerful feature of nc-file transfer. The example of www.2cto.com is as follows: target Host listening nc-l listening port [unused port]> name of the file to be received nc-l 4444> cache.tar.gz source host initiating request nc destination host ip destination port <file nc to be sent 192.168.0.85 4444 </root/cache.tar.gz netstat is as follows [root @ localhost jiangbao] # netstat-tpln tcp 0 0 0.0.0.0: 4444 0.0.0.0: * LISTEN 18166/nc www.2cto.com the following is an English description of data transfer Start by using nc to listen on a specific port, with output captured into a file: $ nc-l 1234> filename. out Usi Ng a second machine, connect to the listening nc process, feeding it the file which is to be transferred: $ nc host.example.com 1234 <filename. other options of nc attached to in: Syntax: nc [-hlnruz] [-g <gateway...>] [-G <Number of pointers>] [-I <delay in seconds>] [-o <output file>] [-p <communication port>] [-s <source address>] [-v...] [-w <timeout seconds>] [host name] [communication port...] note: You can run this command to set vro parameters. Parameter quantity:-g <gateway> sets the router hop communication gateway. You can set up to eight parameter values. -G <Number of pointers> sets the source route indicator, which is a multiple of 4. -H online help. -I <latency in seconds> set the interval to send information and scan the communication port. -L use the listener mode to control incoming data. -N directly uses the IP address instead of the Domain Name Server. -P <communication port> sets the communication port used by the local host. -R: Specifies the communication port between the local host and the remote host. -S <source address> sets the IP address of the data packet sent from the local host. -U uses UDP transmission protocol. -V shows the command execution process. -W <timeout seconds> sets the waiting time. -Z uses the 0 input/output mode, which is only used when scanning the communication port

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.