Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telnet File Transfer between two linux machines [closed]

I want to send a file from one Linux machine with IP suppose "192.168.2.25" to other Linux machine that's a server "192.168.2.110"

how can i do that by using Telnet command??

like image 288
Rajeev Das Avatar asked Apr 04 '13 09:04

Rajeev Das


People also ask

How do I telnet from one Linux server to another?

To use telnet command to log in to a server, use the syntax below. In the black console, specify the username and password. To login using putty, enter the server's IP address and click on the 'Telnet' radio button as shown.


2 Answers

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.

like image 86
Keith Morgan Avatar answered Oct 11 '22 19:10

Keith Morgan


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.

like image 44
MrW Avatar answered Oct 11 '22 19:10

MrW