ssh connection timed out

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I just started to experiment with ssh and port forwarding. I use ubuntu to ssh into my iMac. The iMac says to use ssh user1@host and that works fine when I am using the same network. However, when I connect to my Ubuntu to another network, say at work, and try to ssh into my iMac with ssh -v -v -v user1@host -p 22 I get the following output:



debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connect to address user1@host port 22: Connection timed out



I setup my router to forward port 22 to my iMac's ip address--I'm not sure if my ISP is blocking this port, I still need to check this. My router is Netgear Nighthawk R7800 AC2600. Is there anything I need to setup in Ubuntu, in the ssh_config file, to make this connection work?







share|improve this question
























    up vote
    0
    down vote

    favorite












    I just started to experiment with ssh and port forwarding. I use ubuntu to ssh into my iMac. The iMac says to use ssh user1@host and that works fine when I am using the same network. However, when I connect to my Ubuntu to another network, say at work, and try to ssh into my iMac with ssh -v -v -v user1@host -p 22 I get the following output:



    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connect to address user1@host port 22: Connection timed out



    I setup my router to forward port 22 to my iMac's ip address--I'm not sure if my ISP is blocking this port, I still need to check this. My router is Netgear Nighthawk R7800 AC2600. Is there anything I need to setup in Ubuntu, in the ssh_config file, to make this connection work?







    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I just started to experiment with ssh and port forwarding. I use ubuntu to ssh into my iMac. The iMac says to use ssh user1@host and that works fine when I am using the same network. However, when I connect to my Ubuntu to another network, say at work, and try to ssh into my iMac with ssh -v -v -v user1@host -p 22 I get the following output:



      debug1: Reading configuration data /etc/ssh/ssh_config
      debug1: /etc/ssh/ssh_config line 19: Applying options for *
      debug2: ssh_connect: needpriv 0
      debug1: Connect to address user1@host port 22: Connection timed out



      I setup my router to forward port 22 to my iMac's ip address--I'm not sure if my ISP is blocking this port, I still need to check this. My router is Netgear Nighthawk R7800 AC2600. Is there anything I need to setup in Ubuntu, in the ssh_config file, to make this connection work?







      share|improve this question












      I just started to experiment with ssh and port forwarding. I use ubuntu to ssh into my iMac. The iMac says to use ssh user1@host and that works fine when I am using the same network. However, when I connect to my Ubuntu to another network, say at work, and try to ssh into my iMac with ssh -v -v -v user1@host -p 22 I get the following output:



      debug1: Reading configuration data /etc/ssh/ssh_config
      debug1: /etc/ssh/ssh_config line 19: Applying options for *
      debug2: ssh_connect: needpriv 0
      debug1: Connect to address user1@host port 22: Connection timed out



      I setup my router to forward port 22 to my iMac's ip address--I'm not sure if my ISP is blocking this port, I still need to check this. My router is Netgear Nighthawk R7800 AC2600. Is there anything I need to setup in Ubuntu, in the ssh_config file, to make this connection work?









      share|improve this question











      share|improve this question




      share|improve this question










      asked May 16 at 15:14









      d84_n1nj4

      1012




      1012




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I would recommend using canyouseeme.org to check if your ISP is blocking SSH.



          I would also check that your iMac is getting a static IP address - otherwise, it'll change, meaning the port forward you set up will become obsolete.



          I wanted to add that opening up SSH as you describe is very dangerous. You should use something to block abuse. For example, right now, I have a web server with SSH open, running fail2ban.



          fail2ban works by routing IP addresses to 0.0.0.0 in iptables.
          I've configured it so that if you get the password wrong twice, it blocks your IP address for a long time. The incorrect attempts must be within 24 hours of each other.



          I just ran sudo iptables -L -n | grep -c 0.0.0.0 which counts how many IP addresses are blocked right now. It returned 356, and this is on a site which barely has any visitors.



          If you're opening up ports through your firewall to your home PC, bots are going to find it and break in. I don't know how you go about installing this sort of a thing in macOS, but I'd highly recommend doing so.






          share|improve this answer
















          • 1




            Thanks for the advice, I'll look into fail2ban and use canyouseeme.org. I'll report back tonight.
            – d84_n1nj4
            May 16 at 16:01










          • I ended up fixing the issue. I was using the incorrect ip address when I was ssh'ing into my router. I was originally using the ip address my iMac told me to use under Remote Login. This worked when I was on the same network but not when I was on another network. I had to use the router ip address found on the router setup page. I'll leave this here since it may help someone. Now I need to find out how to configure fail2ban on Mac OS X 10.13. There seems to be very little new documentation.
            – d84_n1nj4
            May 17 at 12:25










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037005%2fssh-connection-timed-out%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          I would recommend using canyouseeme.org to check if your ISP is blocking SSH.



          I would also check that your iMac is getting a static IP address - otherwise, it'll change, meaning the port forward you set up will become obsolete.



          I wanted to add that opening up SSH as you describe is very dangerous. You should use something to block abuse. For example, right now, I have a web server with SSH open, running fail2ban.



          fail2ban works by routing IP addresses to 0.0.0.0 in iptables.
          I've configured it so that if you get the password wrong twice, it blocks your IP address for a long time. The incorrect attempts must be within 24 hours of each other.



          I just ran sudo iptables -L -n | grep -c 0.0.0.0 which counts how many IP addresses are blocked right now. It returned 356, and this is on a site which barely has any visitors.



          If you're opening up ports through your firewall to your home PC, bots are going to find it and break in. I don't know how you go about installing this sort of a thing in macOS, but I'd highly recommend doing so.






          share|improve this answer
















          • 1




            Thanks for the advice, I'll look into fail2ban and use canyouseeme.org. I'll report back tonight.
            – d84_n1nj4
            May 16 at 16:01










          • I ended up fixing the issue. I was using the incorrect ip address when I was ssh'ing into my router. I was originally using the ip address my iMac told me to use under Remote Login. This worked when I was on the same network but not when I was on another network. I had to use the router ip address found on the router setup page. I'll leave this here since it may help someone. Now I need to find out how to configure fail2ban on Mac OS X 10.13. There seems to be very little new documentation.
            – d84_n1nj4
            May 17 at 12:25














          up vote
          0
          down vote













          I would recommend using canyouseeme.org to check if your ISP is blocking SSH.



          I would also check that your iMac is getting a static IP address - otherwise, it'll change, meaning the port forward you set up will become obsolete.



          I wanted to add that opening up SSH as you describe is very dangerous. You should use something to block abuse. For example, right now, I have a web server with SSH open, running fail2ban.



          fail2ban works by routing IP addresses to 0.0.0.0 in iptables.
          I've configured it so that if you get the password wrong twice, it blocks your IP address for a long time. The incorrect attempts must be within 24 hours of each other.



          I just ran sudo iptables -L -n | grep -c 0.0.0.0 which counts how many IP addresses are blocked right now. It returned 356, and this is on a site which barely has any visitors.



          If you're opening up ports through your firewall to your home PC, bots are going to find it and break in. I don't know how you go about installing this sort of a thing in macOS, but I'd highly recommend doing so.






          share|improve this answer
















          • 1




            Thanks for the advice, I'll look into fail2ban and use canyouseeme.org. I'll report back tonight.
            – d84_n1nj4
            May 16 at 16:01










          • I ended up fixing the issue. I was using the incorrect ip address when I was ssh'ing into my router. I was originally using the ip address my iMac told me to use under Remote Login. This worked when I was on the same network but not when I was on another network. I had to use the router ip address found on the router setup page. I'll leave this here since it may help someone. Now I need to find out how to configure fail2ban on Mac OS X 10.13. There seems to be very little new documentation.
            – d84_n1nj4
            May 17 at 12:25












          up vote
          0
          down vote










          up vote
          0
          down vote









          I would recommend using canyouseeme.org to check if your ISP is blocking SSH.



          I would also check that your iMac is getting a static IP address - otherwise, it'll change, meaning the port forward you set up will become obsolete.



          I wanted to add that opening up SSH as you describe is very dangerous. You should use something to block abuse. For example, right now, I have a web server with SSH open, running fail2ban.



          fail2ban works by routing IP addresses to 0.0.0.0 in iptables.
          I've configured it so that if you get the password wrong twice, it blocks your IP address for a long time. The incorrect attempts must be within 24 hours of each other.



          I just ran sudo iptables -L -n | grep -c 0.0.0.0 which counts how many IP addresses are blocked right now. It returned 356, and this is on a site which barely has any visitors.



          If you're opening up ports through your firewall to your home PC, bots are going to find it and break in. I don't know how you go about installing this sort of a thing in macOS, but I'd highly recommend doing so.






          share|improve this answer












          I would recommend using canyouseeme.org to check if your ISP is blocking SSH.



          I would also check that your iMac is getting a static IP address - otherwise, it'll change, meaning the port forward you set up will become obsolete.



          I wanted to add that opening up SSH as you describe is very dangerous. You should use something to block abuse. For example, right now, I have a web server with SSH open, running fail2ban.



          fail2ban works by routing IP addresses to 0.0.0.0 in iptables.
          I've configured it so that if you get the password wrong twice, it blocks your IP address for a long time. The incorrect attempts must be within 24 hours of each other.



          I just ran sudo iptables -L -n | grep -c 0.0.0.0 which counts how many IP addresses are blocked right now. It returned 356, and this is on a site which barely has any visitors.



          If you're opening up ports through your firewall to your home PC, bots are going to find it and break in. I don't know how you go about installing this sort of a thing in macOS, but I'd highly recommend doing so.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 16 at 15:58









          Tom Harris

          466




          466







          • 1




            Thanks for the advice, I'll look into fail2ban and use canyouseeme.org. I'll report back tonight.
            – d84_n1nj4
            May 16 at 16:01










          • I ended up fixing the issue. I was using the incorrect ip address when I was ssh'ing into my router. I was originally using the ip address my iMac told me to use under Remote Login. This worked when I was on the same network but not when I was on another network. I had to use the router ip address found on the router setup page. I'll leave this here since it may help someone. Now I need to find out how to configure fail2ban on Mac OS X 10.13. There seems to be very little new documentation.
            – d84_n1nj4
            May 17 at 12:25












          • 1




            Thanks for the advice, I'll look into fail2ban and use canyouseeme.org. I'll report back tonight.
            – d84_n1nj4
            May 16 at 16:01










          • I ended up fixing the issue. I was using the incorrect ip address when I was ssh'ing into my router. I was originally using the ip address my iMac told me to use under Remote Login. This worked when I was on the same network but not when I was on another network. I had to use the router ip address found on the router setup page. I'll leave this here since it may help someone. Now I need to find out how to configure fail2ban on Mac OS X 10.13. There seems to be very little new documentation.
            – d84_n1nj4
            May 17 at 12:25







          1




          1




          Thanks for the advice, I'll look into fail2ban and use canyouseeme.org. I'll report back tonight.
          – d84_n1nj4
          May 16 at 16:01




          Thanks for the advice, I'll look into fail2ban and use canyouseeme.org. I'll report back tonight.
          – d84_n1nj4
          May 16 at 16:01












          I ended up fixing the issue. I was using the incorrect ip address when I was ssh'ing into my router. I was originally using the ip address my iMac told me to use under Remote Login. This worked when I was on the same network but not when I was on another network. I had to use the router ip address found on the router setup page. I'll leave this here since it may help someone. Now I need to find out how to configure fail2ban on Mac OS X 10.13. There seems to be very little new documentation.
          – d84_n1nj4
          May 17 at 12:25




          I ended up fixing the issue. I was using the incorrect ip address when I was ssh'ing into my router. I was originally using the ip address my iMac told me to use under Remote Login. This worked when I was on the same network but not when I was on another network. I had to use the router ip address found on the router setup page. I'll leave this here since it may help someone. Now I need to find out how to configure fail2ban on Mac OS X 10.13. There seems to be very little new documentation.
          – d84_n1nj4
          May 17 at 12:25












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037005%2fssh-connection-timed-out%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491