SSH and Telnet Connection refused

63,680

Solution 1

You can determine if programs on the server are listening to the ssh and telnet ports (22 and 23, usually), by:

nmap -T4 -A -v -PE -PS22,23 -PA22,23 <ServerIP>  

or,

telnet <ServerIP> 22  
telnet <ServerIP> 23  

If your error message is: telnet: Unable to connect to remote host: Connection refused the problem is on the remote server (no program is listening to that port). It's not running the telnet or ssh daemon,or running them on non-standard ports

Solution 2

Make sure your telnet daemon and ssh is running in ur remote system.

In ubuntu ,

To enable telnet daemon, "sudo apt-get install telnetd" To enable ssh client and server ."sudo apt-get install ssh-connection"

Share:
63,680

Related videos on Youtube

MohammedSimba
Author by

MohammedSimba

Updated on September 18, 2022

Comments

  • MohammedSimba
    MohammedSimba over 1 year

    If I am trying to ssh or telnet to an Ubuntu Server, and both connections are rejected or refused!

    I can ping the server, firewall off.

    What are troubleshooting steps should I take?

    (I am far away from the Server, so console solution isn't available).

    • PavanDevarakonda
      PavanDevarakonda almost 10 years
      Similar issue for me on my VirtulBox Guest ubuntu happening. Ping working, telnet to ssh port 22 is working but when I have started WebLogic server it is not able give access, connfection refused. What is the solution for this issue? How to fix it?
    • PKumar
      PKumar over 8 years
      check if service are listening on that ports use this command "netstat -ntlp"