SSH problems, I keep getting connection refused
Clash 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:
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.
ubuntu ssh openssh
add a comment |Â
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:
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.
ubuntu ssh openssh
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
add a comment |Â
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:
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.
ubuntu ssh openssh
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:
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.
ubuntu ssh openssh
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
add a comment |Â
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
add a comment |Â
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:
Try connecting on port 22, e.g.
ssh 198.168.80.131
, orTry adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.
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
 |Â
show 3 more comments
up vote
0
down vote
Check the following
Edit
/etc/ssh/sshd_config
to listen onPort 2222
.Make sure there is no
#
in front of thePort
number(this comments/cancels out anything but defaults)Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.
When using
ssh
on any other port but 22 your command will have to be something like thisssh user@host -p 2222
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
orsystemctl 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
add a comment |Â
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
add a comment |Â
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:
Try connecting on port 22, e.g.
ssh 198.168.80.131
, orTry adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.
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
 |Â
show 3 more comments
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:
Try connecting on port 22, e.g.
ssh 198.168.80.131
, orTry adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.
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
 |Â
show 3 more comments
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:
Try connecting on port 22, e.g.
ssh 198.168.80.131
, orTry adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.
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:
Try connecting on port 22, e.g.
ssh 198.168.80.131
, orTry adding an ALLOW rule for port 2222 (via your router's administrative GUI) before trying to connect on port 2222 again.
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
 |Â
show 3 more comments
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
 |Â
show 3 more comments
up vote
0
down vote
Check the following
Edit
/etc/ssh/sshd_config
to listen onPort 2222
.Make sure there is no
#
in front of thePort
number(this comments/cancels out anything but defaults)Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.
When using
ssh
on any other port but 22 your command will have to be something like thisssh user@host -p 2222
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
orsystemctl 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
add a comment |Â
up vote
0
down vote
Check the following
Edit
/etc/ssh/sshd_config
to listen onPort 2222
.Make sure there is no
#
in front of thePort
number(this comments/cancels out anything but defaults)Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.
When using
ssh
on any other port but 22 your command will have to be something like thisssh user@host -p 2222
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
orsystemctl 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
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Check the following
Edit
/etc/ssh/sshd_config
to listen onPort 2222
.Make sure there is no
#
in front of thePort
number(this comments/cancels out anything but defaults)Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.
When using
ssh
on any other port but 22 your command will have to be something like thisssh user@host -p 2222
Check the following
Edit
/etc/ssh/sshd_config
to listen onPort 2222
.Make sure there is no
#
in front of thePort
number(this comments/cancels out anything but defaults)Allow port 2222 through your firewall as changing the port from 22 to 2222 does not change it automatically for most firewall profiles.
When using
ssh
on any other port but 22 your command will have to be something like thisssh user@host -p 2222
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
orsystemctl 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
add a comment |Â
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
orsystemctl 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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
edited Oct 29 '17 at 18:47
Stephen Rauch
3,248101227
3,248101227
answered Oct 29 '17 at 18:27
Yvan
11
11
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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