RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sun Sep 15, 2019 10:43 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Feb 09, 2016 10:01 pm 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
Netcat, aka nc(1), is a great networking tool that does just about anything you can think of.
You can also use it as a quick file transfer client/server. I was getting frustrated that I couldn't get ftp(1) to transfer files off of my LiteBSD QEMU image but then I remembered that this is exactly why I ported nc(1) to LiteBSD.

We know that LiteBSD already has nc(1) but you need to make sure that your server has it (just type 'nc' at a terminal on the server: if it does something then you're good).

You need to setup the server first. The command is:
Code:
$ nc -l -p 22222 > file

You can change 22222 to whatever port number you want to use and file to the name you want the received file to have.
The server will now sit patiently and wait until something sends data to port 22222.

Now, on your LiteBSD machine, issue this command:
Code:
$ nc hostname 22222 < file

Where hostname is the IP address of the server (if you are on QEMU and want to send a file to the host machine, the hostname is 10.0.2.2), and file is the name of the file you want to send.

And that's it! nc(1) will quit automatically on both ends once the file transfer is finished.
Remember though that these file transfers are unencrypted, so best to do this on a LAN and not over the open Internet.

_________________
@__briancallahan on Twitter


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission