SSH problems, I keep getting connection refused

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











up vote
1
down vote

favorite












Every time I try to connect via SSH using "ssh user@ip" I get this error:




ssh: connect to host 192.168.80.131 port 22:Connection refused




I check to see if I have my router set up for port forwarding and I guess I do:



enter image description here



I checked if I have my server set up for port forwarding:



tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 
tcp6 0 0 :::22 :::* LISTEN


I also checked to see if my firewall is configured:



To Action From

20 ALLOW Anywhere
22 ALLOW Anywhere
80 ALLOW Anywhere
23 ALLOW Anywhere
8080 ALLOW Anywhere
20 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
23 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)


I also have ssh, openssh-client, openssh-server installed on my server.



Also I would like to mention that the client from where I am connecting to the server is connected to the router via LAN and the server is connected to the router via Wi-FI.







share|improve this question


















  • 1




    It's not totally clear what's going on here. You might want to add more background. What ssh command are you using, e.g. ssh -p 2222 192.168.80.131.
    – igal
    Oct 29 '17 at 18:37






  • 1




    Are you trying to connect your LAN machine from the Internet by using the command: ssh 192.168.80.131 ... if so, that's the first problem. It also looks like you have a NAT problem where external port 2222 should be mapped to internal port 22, since that is the port being used by your internal running ssh.
    – RubberStamp
    Oct 29 '17 at 19:29










  • I'm sorry, could you please expand a bit on the NAT problem, I am not sure what that means.
    – Di Nu
    Oct 30 '17 at 8:28










  • I edited my original post, It seems that I had a mistake in it, it was supposed to have an error containing port 22 not 2222. Sorry about that.
    – Di Nu
    Oct 30 '17 at 8:31














up vote
1
down vote

favorite












Every time I try to connect via SSH using "ssh user@ip" I get this error:




ssh: connect to host 192.168.80.131 port 22:Connection refused




I check to see if I have my router set up for port forwarding and I guess I do:



enter image description here



I checked if I have my server set up for port forwarding:



tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 
tcp6 0 0 :::22 :::* LISTEN


I also checked to see if my firewall is configured:



To Action From

20 ALLOW Anywhere
22 ALLOW Anywhere
80 ALLOW Anywhere
23 ALLOW Anywhere
8080 ALLOW Anywhere
20 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
23 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)


I also have ssh, openssh-client, openssh-server installed on my server.



Also I would like to mention that the client from where I am connecting to the server is connected to the router via LAN and the server is connected to the router via Wi-FI.







share|improve this question


















  • 1




    It's not totally clear what's going on here. You might want to add more background. What ssh command are you using, e.g. ssh -p 2222 192.168.80.131.
    – igal
    Oct 29 '17 at 18:37






  • 1




    Are you trying to connect your LAN machine from the Internet by using the command: ssh 192.168.80.131 ... if so, that's the first problem. It also looks like you have a NAT problem where external port 2222 should be mapped to internal port 22, since that is the port being used by your internal running ssh.
    – RubberStamp
    Oct 29 '17 at 19:29










  • I'm sorry, could you please expand a bit on the NAT problem, I am not sure what that means.
    – Di Nu
    Oct 30 '17 at 8:28










  • I edited my original post, It seems that I had a mistake in it, it was supposed to have an error containing port 22 not 2222. Sorry about that.
    – Di Nu
    Oct 30 '17 at 8:31












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Every time I try to connect via SSH using "ssh user@ip" I get this error:




ssh: connect to host 192.168.80.131 port 22:Connection refused




I check to see if I have my router set up for port forwarding and I guess I do:



enter image description here



I checked if I have my server set up for port forwarding:



tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 
tcp6 0 0 :::22 :::* LISTEN


I also checked to see if my firewall is configured:



To Action From

20 ALLOW Anywhere
22 ALLOW Anywhere
80 ALLOW Anywhere
23 ALLOW Anywhere
8080 ALLOW Anywhere
20 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
23 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)


I also have ssh, openssh-client, openssh-server installed on my server.



Also I would like to mention that the client from where I am connecting to the server is connected to the router via LAN and the server is connected to the router via Wi-FI.







share|improve this question














Every time I try to connect via SSH using "ssh user@ip" I get this error:




ssh: connect to host 192.168.80.131 port 22:Connection refused




I check to see if I have my router set up for port forwarding and I guess I do:



enter image description here



I checked if I have my server set up for port forwarding:



tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 
tcp6 0 0 :::22 :::* LISTEN


I also checked to see if my firewall is configured:



To Action From

20 ALLOW Anywhere
22 ALLOW Anywhere
80 ALLOW Anywhere
23 ALLOW Anywhere
8080 ALLOW Anywhere
20 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
23 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)


I also have ssh, openssh-client, openssh-server installed on my server.



Also I would like to mention that the client from where I am connecting to the server is connected to the router via LAN and the server is connected to the router via Wi-FI.









share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '17 at 17:58









Jeff Schaller

32.1k849109




32.1k849109










asked Oct 29 '17 at 18:23









Di Nu

613




613







  • 1




    It's not totally clear what's going on here. You might want to add more background. What ssh command are you using, e.g. ssh -p 2222 192.168.80.131.
    – igal
    Oct 29 '17 at 18:37






  • 1




    Are you trying to connect your LAN machine from the Internet by using the command: ssh 192.168.80.131 ... if so, that's the first problem. It also looks like you have a NAT problem where external port 2222 should be mapped to internal port 22, since that is the port being used by your internal running ssh.
    – RubberStamp
    Oct 29 '17 at 19:29










  • I'm sorry, could you please expand a bit on the NAT problem, I am not sure what that means.
    – Di Nu
    Oct 30 '17 at 8:28










  • I edited my original post, It seems that I had a mistake in it, it was supposed to have an error containing port 22 not 2222. Sorry about that.
    – Di Nu
    Oct 30 '17 at 8:31












  • 1




    It's not totally clear what's going on here. You might want to add more background. What ssh command are you using, e.g. ssh -p 2222 192.168.80.131.
    – igal
    Oct 29 '17 at 18:37






  • 1




    Are you trying to connect your LAN machine from the Internet by using the command: ssh 192.168.80.131 ... if so, that's the first problem. It also looks like you have a NAT problem where external port 2222 should be mapped to internal port 22, since that is the port being used by your internal running ssh.
    – RubberStamp
    Oct 29 '17 at 19:29










  • I'm sorry, could you please expand a bit on the NAT problem, I am not sure what that means.
    – Di Nu
    Oct 30 '17 at 8:28










  • I edited my original post, It seems that I had a mistake in it, it was supposed to have an error containing port 22 not 2222. Sorry about that.
    – Di Nu
    Oct 30 '17 at 8:31







1




1




It's not totally clear what's going on here. You might want to add more background. What ssh command are you using, e.g. ssh -p 2222 192.168.80.131.
– igal
Oct 29 '17 at 18:37




It's not totally clear what's going on here. You might want to add more background. What ssh command are you using, e.g. ssh -p 2222 192.168.80.131.
– igal
Oct 29 '17 at 18:37




1




1




Are you trying to connect your LAN machine from the Internet by using the command: ssh 192.168.80.131 ... if so, that's the first problem. It also looks like you have a NAT problem where external port 2222 should be mapped to internal port 22, since that is the port being used by your internal running ssh.
– RubberStamp
Oct 29 '17 at 19:29




Are you trying to connect your LAN machine from the Internet by using the command: ssh 192.168.80.131 ... if so, that's the first problem. It also looks like you have a NAT problem where external port 2222 should be mapped to internal port 22, since that is the port being used by your internal running ssh.
– RubberStamp
Oct 29 '17 at 19:29












I'm sorry, could you please expand a bit on the NAT problem, I am not sure what that means.
– Di Nu
Oct 30 '17 at 8:28




I'm sorry, could you please expand a bit on the NAT problem, I am not sure what that means.
– Di Nu
Oct 30 '17 at 8:28












I edited my original post, It seems that I had a mistake in it, it was supposed to have an error containing port 22 not 2222. Sorry about that.
– Di Nu
Oct 30 '17 at 8:31




I edited my original post, It seems that I had a mistake in it, it was supposed to have an error containing port 22 not 2222. Sorry about that.
– Di Nu
Oct 30 '17 at 8:31










3 Answers
3






active

oldest

votes

















up vote
1
down vote













According to your problem statement, you get the following error:



ssh: connect to host 192.168.80.131 port 2222:Connection refused


This suggests that you're trying to connect to the server on port 2222, e.g. that you're using a command like the following one:



ssh -p 2222 192.168.80.131


You also posted the following list of firewall rules:



20 ALLOW Anywhere
22 ALLOW Anywhere
80 ALLOW Anywhere
23 ALLOW Anywhere
8080 ALLOW Anywhere
20 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
23 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)


It looks like port 2222 is missing from this list.



You also posted a screen-shot of what appears to be your router's administrative GUI which shows a port-forwarding configuration page which included SSH rules for both port 22 and port 2222. You haven't included enough information for me to determine exactly what your network looks like, but it appears that you'd like to connect to a host on one of these two ports.



Two obvious next-steps come to mind:



  1. Try connecting on port 22, e.g. ssh 198.168.80.131, or


  2. Try adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.






share|improve this answer






















  • Hi,thank you very much for your answer, I posted the wrong message, I usually get port 22 error "ssh: connect to host 192.168.80.131 port 22:Connection refused" but at that point I tried connecting to port 2222 with some "tweeking". The command I am using is "ssh user_name@192.168.80.131".
    – Di Nu
    Oct 30 '17 at 8:24










  • Also I modified my post to reflect that and I added the correct error message. Maybe I should also mention that I am trying to connect from the same router just too different computers, so I have one computer that is connected to the router via LAN which would be the client and one that is connected via WIFI which would be the server, Im not sure how relevant that is but... If you need more info please let me know
    – Di Nu
    Oct 30 '17 at 8:34










  • I read about something called "Bridge", Im not sure if I have that set up or if I should set that up...
    – Di Nu
    Oct 30 '17 at 8:46










  • @DiNu Why are you using port-forwarding? Also, can you ping one computer from the other?
    – igal
    Oct 30 '17 at 12:25










  • I thought that is the way to do it, use prot-forwarding to use ssh. No I cannot, if I try "ping 192.168.80.131" from the client it does nothing...
    – Di Nu
    Oct 30 '17 at 14:21

















up vote
0
down vote













Check the following



  1. Edit /etc/ssh/sshd_config to listen on Port 2222.


  2. Make sure there is no # in front of the Port number(this comments/cancels out anything but defaults)


  3. Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.


  4. When using ssh on any other port but 22 your command will have to be something like this ssh user@host -p 2222






share|improve this answer




















  • Thank you very much for your response, I have tried this and its still the same problem :(
    – Di Nu
    Oct 30 '17 at 10:02










  • Have you reset sshd after making changes? service sshd restart or systemctl restart sshd? Like wise with your router and fire wall?
    – m_krsic
    Oct 30 '17 at 17:08











  • yes, I have restarted all of them, still no change...
    – Di Nu
    Oct 30 '17 at 17:35










  • Change them to 50000 or higher. Your router may have some ports reserved. Also try and enter a single value not a range, ie. just 2222 not 2222-2222. Try and only put the port number into sshd. No addresses, comment them out with the #
    – m_krsic
    Oct 30 '17 at 19:38


















up vote
-1
down vote













Try using:



ssh user@host -p 'port'


where 'port' is ether 22 or 2222. I don't know which port is the actual one you're using right now, 2222 or 22. If you don't know send sshd_config






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f401261%2fssh-problems-i-keep-getting-connection-refused%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    According to your problem statement, you get the following error:



    ssh: connect to host 192.168.80.131 port 2222:Connection refused


    This suggests that you're trying to connect to the server on port 2222, e.g. that you're using a command like the following one:



    ssh -p 2222 192.168.80.131


    You also posted the following list of firewall rules:



    20 ALLOW Anywhere
    22 ALLOW Anywhere
    80 ALLOW Anywhere
    23 ALLOW Anywhere
    8080 ALLOW Anywhere
    20 (v6) ALLOW Anywhere (v6)
    22 (v6) ALLOW Anywhere (v6)
    80 (v6) ALLOW Anywhere (v6)
    23 (v6) ALLOW Anywhere (v6)
    8080 (v6) ALLOW Anywhere (v6)


    It looks like port 2222 is missing from this list.



    You also posted a screen-shot of what appears to be your router's administrative GUI which shows a port-forwarding configuration page which included SSH rules for both port 22 and port 2222. You haven't included enough information for me to determine exactly what your network looks like, but it appears that you'd like to connect to a host on one of these two ports.



    Two obvious next-steps come to mind:



    1. Try connecting on port 22, e.g. ssh 198.168.80.131, or


    2. Try adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.






    share|improve this answer






















    • Hi,thank you very much for your answer, I posted the wrong message, I usually get port 22 error "ssh: connect to host 192.168.80.131 port 22:Connection refused" but at that point I tried connecting to port 2222 with some "tweeking". The command I am using is "ssh user_name@192.168.80.131".
      – Di Nu
      Oct 30 '17 at 8:24










    • Also I modified my post to reflect that and I added the correct error message. Maybe I should also mention that I am trying to connect from the same router just too different computers, so I have one computer that is connected to the router via LAN which would be the client and one that is connected via WIFI which would be the server, Im not sure how relevant that is but... If you need more info please let me know
      – Di Nu
      Oct 30 '17 at 8:34










    • I read about something called "Bridge", Im not sure if I have that set up or if I should set that up...
      – Di Nu
      Oct 30 '17 at 8:46










    • @DiNu Why are you using port-forwarding? Also, can you ping one computer from the other?
      – igal
      Oct 30 '17 at 12:25










    • I thought that is the way to do it, use prot-forwarding to use ssh. No I cannot, if I try "ping 192.168.80.131" from the client it does nothing...
      – Di Nu
      Oct 30 '17 at 14:21














    up vote
    1
    down vote













    According to your problem statement, you get the following error:



    ssh: connect to host 192.168.80.131 port 2222:Connection refused


    This suggests that you're trying to connect to the server on port 2222, e.g. that you're using a command like the following one:



    ssh -p 2222 192.168.80.131


    You also posted the following list of firewall rules:



    20 ALLOW Anywhere
    22 ALLOW Anywhere
    80 ALLOW Anywhere
    23 ALLOW Anywhere
    8080 ALLOW Anywhere
    20 (v6) ALLOW Anywhere (v6)
    22 (v6) ALLOW Anywhere (v6)
    80 (v6) ALLOW Anywhere (v6)
    23 (v6) ALLOW Anywhere (v6)
    8080 (v6) ALLOW Anywhere (v6)


    It looks like port 2222 is missing from this list.



    You also posted a screen-shot of what appears to be your router's administrative GUI which shows a port-forwarding configuration page which included SSH rules for both port 22 and port 2222. You haven't included enough information for me to determine exactly what your network looks like, but it appears that you'd like to connect to a host on one of these two ports.



    Two obvious next-steps come to mind:



    1. Try connecting on port 22, e.g. ssh 198.168.80.131, or


    2. Try adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.






    share|improve this answer






















    • Hi,thank you very much for your answer, I posted the wrong message, I usually get port 22 error "ssh: connect to host 192.168.80.131 port 22:Connection refused" but at that point I tried connecting to port 2222 with some "tweeking". The command I am using is "ssh user_name@192.168.80.131".
      – Di Nu
      Oct 30 '17 at 8:24










    • Also I modified my post to reflect that and I added the correct error message. Maybe I should also mention that I am trying to connect from the same router just too different computers, so I have one computer that is connected to the router via LAN which would be the client and one that is connected via WIFI which would be the server, Im not sure how relevant that is but... If you need more info please let me know
      – Di Nu
      Oct 30 '17 at 8:34










    • I read about something called "Bridge", Im not sure if I have that set up or if I should set that up...
      – Di Nu
      Oct 30 '17 at 8:46










    • @DiNu Why are you using port-forwarding? Also, can you ping one computer from the other?
      – igal
      Oct 30 '17 at 12:25










    • I thought that is the way to do it, use prot-forwarding to use ssh. No I cannot, if I try "ping 192.168.80.131" from the client it does nothing...
      – Di Nu
      Oct 30 '17 at 14:21












    up vote
    1
    down vote










    up vote
    1
    down vote









    According to your problem statement, you get the following error:



    ssh: connect to host 192.168.80.131 port 2222:Connection refused


    This suggests that you're trying to connect to the server on port 2222, e.g. that you're using a command like the following one:



    ssh -p 2222 192.168.80.131


    You also posted the following list of firewall rules:



    20 ALLOW Anywhere
    22 ALLOW Anywhere
    80 ALLOW Anywhere
    23 ALLOW Anywhere
    8080 ALLOW Anywhere
    20 (v6) ALLOW Anywhere (v6)
    22 (v6) ALLOW Anywhere (v6)
    80 (v6) ALLOW Anywhere (v6)
    23 (v6) ALLOW Anywhere (v6)
    8080 (v6) ALLOW Anywhere (v6)


    It looks like port 2222 is missing from this list.



    You also posted a screen-shot of what appears to be your router's administrative GUI which shows a port-forwarding configuration page which included SSH rules for both port 22 and port 2222. You haven't included enough information for me to determine exactly what your network looks like, but it appears that you'd like to connect to a host on one of these two ports.



    Two obvious next-steps come to mind:



    1. Try connecting on port 22, e.g. ssh 198.168.80.131, or


    2. Try adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.






    share|improve this answer














    According to your problem statement, you get the following error:



    ssh: connect to host 192.168.80.131 port 2222:Connection refused


    This suggests that you're trying to connect to the server on port 2222, e.g. that you're using a command like the following one:



    ssh -p 2222 192.168.80.131


    You also posted the following list of firewall rules:



    20 ALLOW Anywhere
    22 ALLOW Anywhere
    80 ALLOW Anywhere
    23 ALLOW Anywhere
    8080 ALLOW Anywhere
    20 (v6) ALLOW Anywhere (v6)
    22 (v6) ALLOW Anywhere (v6)
    80 (v6) ALLOW Anywhere (v6)
    23 (v6) ALLOW Anywhere (v6)
    8080 (v6) ALLOW Anywhere (v6)


    It looks like port 2222 is missing from this list.



    You also posted a screen-shot of what appears to be your router's administrative GUI which shows a port-forwarding configuration page which included SSH rules for both port 22 and port 2222. You haven't included enough information for me to determine exactly what your network looks like, but it appears that you'd like to connect to a host on one of these two ports.



    Two obvious next-steps come to mind:



    1. Try connecting on port 22, e.g. ssh 198.168.80.131, or


    2. Try adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Oct 29 '17 at 19:17

























    answered Oct 29 '17 at 18:40









    igal

    4,830930




    4,830930











    • Hi,thank you very much for your answer, I posted the wrong message, I usually get port 22 error "ssh: connect to host 192.168.80.131 port 22:Connection refused" but at that point I tried connecting to port 2222 with some "tweeking". The command I am using is "ssh user_name@192.168.80.131".
      – Di Nu
      Oct 30 '17 at 8:24










    • Also I modified my post to reflect that and I added the correct error message. Maybe I should also mention that I am trying to connect from the same router just too different computers, so I have one computer that is connected to the router via LAN which would be the client and one that is connected via WIFI which would be the server, Im not sure how relevant that is but... If you need more info please let me know
      – Di Nu
      Oct 30 '17 at 8:34










    • I read about something called "Bridge", Im not sure if I have that set up or if I should set that up...
      – Di Nu
      Oct 30 '17 at 8:46










    • @DiNu Why are you using port-forwarding? Also, can you ping one computer from the other?
      – igal
      Oct 30 '17 at 12:25










    • I thought that is the way to do it, use prot-forwarding to use ssh. No I cannot, if I try "ping 192.168.80.131" from the client it does nothing...
      – Di Nu
      Oct 30 '17 at 14:21
















    • Hi,thank you very much for your answer, I posted the wrong message, I usually get port 22 error "ssh: connect to host 192.168.80.131 port 22:Connection refused" but at that point I tried connecting to port 2222 with some "tweeking". The command I am using is "ssh user_name@192.168.80.131".
      – Di Nu
      Oct 30 '17 at 8:24










    • Also I modified my post to reflect that and I added the correct error message. Maybe I should also mention that I am trying to connect from the same router just too different computers, so I have one computer that is connected to the router via LAN which would be the client and one that is connected via WIFI which would be the server, Im not sure how relevant that is but... If you need more info please let me know
      – Di Nu
      Oct 30 '17 at 8:34










    • I read about something called "Bridge", Im not sure if I have that set up or if I should set that up...
      – Di Nu
      Oct 30 '17 at 8:46










    • @DiNu Why are you using port-forwarding? Also, can you ping one computer from the other?
      – igal
      Oct 30 '17 at 12:25










    • I thought that is the way to do it, use prot-forwarding to use ssh. No I cannot, if I try "ping 192.168.80.131" from the client it does nothing...
      – Di Nu
      Oct 30 '17 at 14:21















    Hi,thank you very much for your answer, I posted the wrong message, I usually get port 22 error "ssh: connect to host 192.168.80.131 port 22:Connection refused" but at that point I tried connecting to port 2222 with some "tweeking". The command I am using is "ssh user_name@192.168.80.131".
    – Di Nu
    Oct 30 '17 at 8:24




    Hi,thank you very much for your answer, I posted the wrong message, I usually get port 22 error "ssh: connect to host 192.168.80.131 port 22:Connection refused" but at that point I tried connecting to port 2222 with some "tweeking". The command I am using is "ssh user_name@192.168.80.131".
    – Di Nu
    Oct 30 '17 at 8:24












    Also I modified my post to reflect that and I added the correct error message. Maybe I should also mention that I am trying to connect from the same router just too different computers, so I have one computer that is connected to the router via LAN which would be the client and one that is connected via WIFI which would be the server, Im not sure how relevant that is but... If you need more info please let me know
    – Di Nu
    Oct 30 '17 at 8:34




    Also I modified my post to reflect that and I added the correct error message. Maybe I should also mention that I am trying to connect from the same router just too different computers, so I have one computer that is connected to the router via LAN which would be the client and one that is connected via WIFI which would be the server, Im not sure how relevant that is but... If you need more info please let me know
    – Di Nu
    Oct 30 '17 at 8:34












    I read about something called "Bridge", Im not sure if I have that set up or if I should set that up...
    – Di Nu
    Oct 30 '17 at 8:46




    I read about something called "Bridge", Im not sure if I have that set up or if I should set that up...
    – Di Nu
    Oct 30 '17 at 8:46












    @DiNu Why are you using port-forwarding? Also, can you ping one computer from the other?
    – igal
    Oct 30 '17 at 12:25




    @DiNu Why are you using port-forwarding? Also, can you ping one computer from the other?
    – igal
    Oct 30 '17 at 12:25












    I thought that is the way to do it, use prot-forwarding to use ssh. No I cannot, if I try "ping 192.168.80.131" from the client it does nothing...
    – Di Nu
    Oct 30 '17 at 14:21




    I thought that is the way to do it, use prot-forwarding to use ssh. No I cannot, if I try "ping 192.168.80.131" from the client it does nothing...
    – Di Nu
    Oct 30 '17 at 14:21












    up vote
    0
    down vote













    Check the following



    1. Edit /etc/ssh/sshd_config to listen on Port 2222.


    2. Make sure there is no # in front of the Port number(this comments/cancels out anything but defaults)


    3. Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.


    4. When using ssh on any other port but 22 your command will have to be something like this ssh user@host -p 2222






    share|improve this answer




















    • Thank you very much for your response, I have tried this and its still the same problem :(
      – Di Nu
      Oct 30 '17 at 10:02










    • Have you reset sshd after making changes? service sshd restart or systemctl restart sshd? Like wise with your router and fire wall?
      – m_krsic
      Oct 30 '17 at 17:08











    • yes, I have restarted all of them, still no change...
      – Di Nu
      Oct 30 '17 at 17:35










    • Change them to 50000 or higher. Your router may have some ports reserved. Also try and enter a single value not a range, ie. just 2222 not 2222-2222. Try and only put the port number into sshd. No addresses, comment them out with the #
      – m_krsic
      Oct 30 '17 at 19:38















    up vote
    0
    down vote













    Check the following



    1. Edit /etc/ssh/sshd_config to listen on Port 2222.


    2. Make sure there is no # in front of the Port number(this comments/cancels out anything but defaults)


    3. Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.


    4. When using ssh on any other port but 22 your command will have to be something like this ssh user@host -p 2222






    share|improve this answer




















    • Thank you very much for your response, I have tried this and its still the same problem :(
      – Di Nu
      Oct 30 '17 at 10:02










    • Have you reset sshd after making changes? service sshd restart or systemctl restart sshd? Like wise with your router and fire wall?
      – m_krsic
      Oct 30 '17 at 17:08











    • yes, I have restarted all of them, still no change...
      – Di Nu
      Oct 30 '17 at 17:35










    • Change them to 50000 or higher. Your router may have some ports reserved. Also try and enter a single value not a range, ie. just 2222 not 2222-2222. Try and only put the port number into sshd. No addresses, comment them out with the #
      – m_krsic
      Oct 30 '17 at 19:38













    up vote
    0
    down vote










    up vote
    0
    down vote









    Check the following



    1. Edit /etc/ssh/sshd_config to listen on Port 2222.


    2. Make sure there is no # in front of the Port number(this comments/cancels out anything but defaults)


    3. Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.


    4. When using ssh on any other port but 22 your command will have to be something like this ssh user@host -p 2222






    share|improve this answer












    Check the following



    1. Edit /etc/ssh/sshd_config to listen on Port 2222.


    2. Make sure there is no # in front of the Port number(this comments/cancels out anything but defaults)


    3. Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.


    4. When using ssh on any other port but 22 your command will have to be something like this ssh user@host -p 2222







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Oct 30 '17 at 9:02









    m_krsic

    32925




    32925











    • Thank you very much for your response, I have tried this and its still the same problem :(
      – Di Nu
      Oct 30 '17 at 10:02










    • Have you reset sshd after making changes? service sshd restart or systemctl restart sshd? Like wise with your router and fire wall?
      – m_krsic
      Oct 30 '17 at 17:08











    • yes, I have restarted all of them, still no change...
      – Di Nu
      Oct 30 '17 at 17:35










    • Change them to 50000 or higher. Your router may have some ports reserved. Also try and enter a single value not a range, ie. just 2222 not 2222-2222. Try and only put the port number into sshd. No addresses, comment them out with the #
      – m_krsic
      Oct 30 '17 at 19:38

















    • Thank you very much for your response, I have tried this and its still the same problem :(
      – Di Nu
      Oct 30 '17 at 10:02










    • Have you reset sshd after making changes? service sshd restart or systemctl restart sshd? Like wise with your router and fire wall?
      – m_krsic
      Oct 30 '17 at 17:08











    • yes, I have restarted all of them, still no change...
      – Di Nu
      Oct 30 '17 at 17:35










    • Change them to 50000 or higher. Your router may have some ports reserved. Also try and enter a single value not a range, ie. just 2222 not 2222-2222. Try and only put the port number into sshd. No addresses, comment them out with the #
      – m_krsic
      Oct 30 '17 at 19:38
















    Thank you very much for your response, I have tried this and its still the same problem :(
    – Di Nu
    Oct 30 '17 at 10:02




    Thank you very much for your response, I have tried this and its still the same problem :(
    – Di Nu
    Oct 30 '17 at 10:02












    Have you reset sshd after making changes? service sshd restart or systemctl restart sshd? Like wise with your router and fire wall?
    – m_krsic
    Oct 30 '17 at 17:08





    Have you reset sshd after making changes? service sshd restart or systemctl restart sshd? Like wise with your router and fire wall?
    – m_krsic
    Oct 30 '17 at 17:08













    yes, I have restarted all of them, still no change...
    – Di Nu
    Oct 30 '17 at 17:35




    yes, I have restarted all of them, still no change...
    – Di Nu
    Oct 30 '17 at 17:35












    Change them to 50000 or higher. Your router may have some ports reserved. Also try and enter a single value not a range, ie. just 2222 not 2222-2222. Try and only put the port number into sshd. No addresses, comment them out with the #
    – m_krsic
    Oct 30 '17 at 19:38





    Change them to 50000 or higher. Your router may have some ports reserved. Also try and enter a single value not a range, ie. just 2222 not 2222-2222. Try and only put the port number into sshd. No addresses, comment them out with the #
    – m_krsic
    Oct 30 '17 at 19:38











    up vote
    -1
    down vote













    Try using:



    ssh user@host -p 'port'


    where 'port' is ether 22 or 2222. I don't know which port is the actual one you're using right now, 2222 or 22. If you don't know send sshd_config






    share|improve this answer


























      up vote
      -1
      down vote













      Try using:



      ssh user@host -p 'port'


      where 'port' is ether 22 or 2222. I don't know which port is the actual one you're using right now, 2222 or 22. If you don't know send sshd_config






      share|improve this answer
























        up vote
        -1
        down vote










        up vote
        -1
        down vote









        Try using:



        ssh user@host -p 'port'


        where 'port' is ether 22 or 2222. I don't know which port is the actual one you're using right now, 2222 or 22. If you don't know send sshd_config






        share|improve this answer














        Try using:



        ssh user@host -p 'port'


        where 'port' is ether 22 or 2222. I don't know which port is the actual one you're using right now, 2222 or 22. If you don't know send sshd_config







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 29 '17 at 18:47









        Stephen Rauch

        3,248101227




        3,248101227










        answered Oct 29 '17 at 18:27









        Yvan

        11




        11



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401261%2fssh-problems-i-keep-getting-connection-refused%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay