Telnet File Transfer between two linux machines [closed] Telnet File Transfer between two linux machines [closed] linux linux

Telnet File Transfer between two linux machines [closed]


A simple option is to use netcat (nc). This is particularly useful on stripped down Linux systems where services like ssh and ftp are turned off.

On destination machine run the following command: nc -l -p 1234 > out.file

On source machine run the following command: nc -w 3 <dest-ip-adr> 1234 < out.file

For more details look, for example, here.

There are also netcat implementations for Windows, e.g. ncat.


While it may not be possible with only telnet, it is possible with telnet and netcat. Some of the examples above just referenced using netcat, but there have been times when I was on an old machine that was still in production that had telnet but not netcat. In this case, you can set netcat to listen on a newer, remote machine and telnet the file to it.

On the newer remote machine:

netcat -l <PORT> > OUTPUT.FILE

On the older telnet only machine:

cat FILE | telnet REMOTE-HOST PORT

Note that this works with text files. If you have a binary file of some sort you would need to do further manipulation on both ends.


Telnet just gives you a remote terminal session. The best you could do is telnet, open a new file in an editor and copy/paste the text from the local machine.

To copy files use something like rsync, scp, rcp or ftp.