0

I have HOST='xx.xxx.xx.xx' and PORT = xxxx

I tried                    

tn = telnetlib.Telnet(HOST, port=PORT, timeout=5)

I'm getting this error

ConnectionRefusedError: [Errno 61] Connection refused

Is there any other way to telnet to port other than default one?

Mohan Singh
  • 1,142
  • 3
  • 15
  • 30
Miffy
  • 185
  • 1
  • 15
  • This means that there is no telnet service listening on that port. – Burhan Khalid Jan 31 '19 at 06:48
  • Possible duplicate of [What can be the reasons of connection refused errors?](https://stackoverflow.com/questions/2333400/what-can-be-the-reasons-of-connection-refused-errors) – tripleee Jan 31 '19 at 06:51

1 Answers1

2

ConnectionRefused means that the Server refused your connection, which in-turn could mean that telnet service is not running on that port. You can do telnet to any port only as long as the telnet service in running on that port in the server.

Jay
  • 24,173
  • 25
  • 93
  • 141