0

On my local machine some network application is launched on port 3333 and I want to check that it "accepts connections". In this case in Windows I just type telnet to launch telnet client, and then o localhost 3333 to test if I can connect.

How can I do the same in RHEL 7? Should I also use telnet or probably there is another tool? This article suggest to execute yum install xinetd telnet telnet-server but I'm afraid if this will open any ports? I don't want to install any "server" functionality, only "client" telnet application. And definitely I do not want telnet to open any ports.

1

You can install just the telnet package and have telnet client functionality. Alternately, you can use the nc command to test port connectivity if you'd rather not mess with telnet at all.

  • thanks, tried that. by some reason nc localhost 3333 tells "Connection refused", but when I execute telnet and o localhost 3333 i'm able to connect. Do you know what nc doesn't work? – javapowered Nov 12 '14 at 20:13
  • @javapowered nc or telnet might be using IPv4 or IPv6, or might be making different DNS or /etc/hosts lookups. We'd need more information, such as from netstat and so forth. – thrig Sep 13 '18 at 21:42
2
echo -n > /dev/tcp/[hostname/ip]/[port]

return errorcode 0 if successful

  • I don't know why this was downvoted. I was going to mention the same thing. (I've upvoted.) It's a Bash feature; I believe it was introduced in Bash 4. Welcome to the site; thanks for posting this! – Wildcard Sep 13 '18 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.