Score:1

test connectivity between two remote hosts

cn flag

How can I test a connection between two remote hosts from my workstation? Example - I want to test(from my workstation) if server A has connection to a service that is running on port 8087 on server B.

Michael Hampton avatar
cz flag
Just log in to A and try to make the connection. This is trivial. What exactly are you having trouble with?
Score:1
us flag

This is a task for telnet. Telnet is a client-server protocol based on character-oriented data exchange over TCP connections. Telnet enables remote control of computers via text-based inputs and outputs.

Login to server A, then if server B's ip address is 123.456.789.123. from a command prompt enter the telnet command:

telnet 123.456.789.123 8087

If there is an active service on that port you should get a response similar to:

Trying 123.456.789.123...
Connected to server B.
Escape character is '^]'.

For more information about telnet see: https://www.telnet.org/htm/faq.htm

userstack avatar
cn flag
I dont want to login to the source server. I'm looking for a script or program that I can run from my local machine.
Falstone avatar
us flag
OK - I made the mistake that you were working from server A. Is either of the servers on the same LAN as your workstation?
Score:0
gs flag

If you really don't want to login to serverA to test the connectivity to serverB, you could do something like this below although, it really does login and execute the command on serverA under the hood via ssh.

Note: The command below assumes you have netcat (nc) installed on server A otherwise, use whatever tool you want to use to check the connectivity.

ssh user@serverA nc -zv -w 10 serverB 8087
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.