SSH Stopped working

12,549

Things to check on the remote machine (the machine you are connecting to):

  • ssh server is running (which you've already done): sudo service ssh status
  • firewall isn't interfering: sudo iptables -L to check firewall rules
  • basic connectivity: ping 192.168.0.90 (should get a response)
  • physical network issues (cable out, switch down, etc.)
  • both computers are on the same subnet (192.168.0.). If you've reset the router, it could be granting IP addresses on a different subnet than your SSH server's static one.
Share:
12,549

Related videos on Youtube

kaleb
Author by

kaleb

Updated on September 18, 2022

Comments

  • kaleb
    kaleb over 1 year

    I restarted my computer, and now I can't connect to it through ssh on my remote machine. I can connect to it through the host machine, but that's it. It says ssh is running, but I can't connect from another computer.

    • Aaron Hill
      Aaron Hill over 10 years
      What happens when you try to ssh in from the remote computer?
    • kaleb
      kaleb over 10 years
      Using putty it says: "Searching for host..." Then it says "Network error: Connection to myip has timed out"
    • kaleb
      kaleb over 10 years
      Also my terminology might be a little off seeing that i am kind of new to this. By remote do you mean the computer i am trying to connect to. Or the computer i am connecting from?
    • douggro
      douggro over 10 years
      Does your network use DHCP for assigning IP addresses, and are you trying to connect using an IP address, as in ssh [email protected]? If so, rebooting the computer may have resulted in the IP address changing. You can get the IP address of the host through Network Manager on the host computer or through ifconfig in Terminal.
    • kaleb
      kaleb over 10 years
      My ip adress is static so that could not have happened. I am connecting using ssh [email protected]. Im also pretty sure that my network uses DCHP. Also, thanks for the quick response :)
    • Admin
      Admin about 2 years
      Make sure you don't have a VPN running on either PC. I had this problem when running a local network.
  • kaleb
    kaleb over 10 years
    All of it was clear... It worked, but i still cant connect via another computer.
  • jhauris
    jhauris over 10 years
    do you have denyhosts installed? Denyhosts is a really nice program that blocks IP addresses that have N failed authentication attempts. See denyhosts.sourceforge.net/faq.html#3_19 if that's the case.
  • kaleb
    kaleb over 10 years
    I have never installed anything like that.
  • jhauris
    jhauris over 10 years
    I would check anyway, it may have been pulled in by another package. Another thing to check is the /etc/ssh/sshd_config. There are options that would limit what addresses and ports that SSH listens to. Seems unlikely that would be changed, though.
  • kaleb
    kaleb over 10 years
    would you like me to post the config?
  • jhauris
    jhauris over 10 years
    That might help. Can you also think of what you you might have changed on the system since this worked last?
  • kaleb
    kaleb over 10 years
    Here is the sshd config pastebin.com/9QCdZLcX0 Here is the ssh config pastebin.com/pMP8qHgA I did change the ip to a static one, but it has since been changed back due to this problem. Also before i reinstalled ssh, i had put SessionAliveInterval 60 into the ssh config. I dont think that it is there anymore though.
  • jhauris
    jhauris over 10 years
    first link says it's been removed.
  • douggro
    douggro over 10 years
    Have you ruled out a problem with putty by using another Terminal client??