Search code examples
azurevirtual-machinetelnet

telnet doesn't work between two VM in the same virtual network Azure


I have à new account in azure (it's my first time) for test i have two VMs with ip adress 10.0.0.4/5

the ping is ok between the two VM but the telnet don't works

when i do from vm 1

telnet 10.0.0.5

Trying 10.0.0.5...
telnet: Unable to connect to remote host: Connection refused

it works just with port 22 but it don't with other port

i start from scratch and i created a security group but i can't create a network interface in the Azure UI because it not finds my virtual network and my security group knowing i have a one virtual network and one security network. some thing is wrong and i don't know what

can you help me how can i open the connection between my VMs


Solution

  • For a Linux VM, telnet service is not installed by default. According to your error log, it seems that the telnet service is not installed. You should install the service firstly. I install telnet service in my Ubuntu VM.

    Please refer to the article.

    Notes: if /etc/inetd.conf /etc/xinetd.d/telnet not exist, you could create these files manual.

    You could use the following command to ensue whether the port is listening.

    netstat -ant|grep 23

    Based on my knowledge, if you want to telnet by using private IP in the same VNet, you could not open port in Azure NSG. However, if you want to telnet by using Public IP, you should configure NSG (Inbound rule). Please refer to the article.