ssh Connection refused, stuck at âdebug1: Local version stringâ
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm trying to connect to my Redhat AWS instance with a port other than 22.
This command works: ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
The second command outputs:
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to X.X.X.X port 8157.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file my.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file my.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
but then just hangs. On the server I'm trying to connect to, however, when I run nc -l 8157
I can see
SSH-2.0-OpenSSH_7.6
If I take out the -vvv
part I just get a quick "Connection refused" error.
When I log into the machine and run ssh -p 8157 -vvv ec2-user@localhost
I get the following output:
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "localhost" port 8157
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 8157.
debug1: connect to address 127.0.0.1 port 8157: Connection refused
ssh: connect to host localhost port 8157: Connection refused
Any idea what's going on?
ssh openssh
 |Â
show 1 more comment
up vote
0
down vote
favorite
I'm trying to connect to my Redhat AWS instance with a port other than 22.
This command works: ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
The second command outputs:
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to X.X.X.X port 8157.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file my.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file my.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
but then just hangs. On the server I'm trying to connect to, however, when I run nc -l 8157
I can see
SSH-2.0-OpenSSH_7.6
If I take out the -vvv
part I just get a quick "Connection refused" error.
When I log into the machine and run ssh -p 8157 -vvv ec2-user@localhost
I get the following output:
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "localhost" port 8157
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 8157.
debug1: connect to address 127.0.0.1 port 8157: Connection refused
ssh: connect to host localhost port 8157: Connection refused
Any idea what's going on?
ssh openssh
Have you opened up the firewall or changed the AWS security policies to allow access to that port?
â GracefulRestart
Mar 22 at 23:24
If you login to the AWS system and then runssh ... ec2-user@localhost
, does that work?
â Mark Plotnick
Mar 22 at 23:24
@GracefulRestart Yes, I've opened up the security group on the instance. I've also checked the VPC flow logs and I can see my source and target IP and the 8157 port showing up as "ACCEPT OK", so I don't think it's an AWS firewall issue. Also, if the security group were the issue I wouldn't be able to establish a connect at all, right? The ssh verbose command saysConnection established
, so I think it's getting through, it's just not finishing.
â user554481
Mar 22 at 23:35
@MarkPlotnick What could go in the. . .
? I didn't know you could connect to localhost. I'm guessing I would just dossh -p 8157 ec2-user@localhost
?
â user554481
Mar 22 at 23:37
Same command -ssh -i my.pem -p 8157 -vvv ec2-user@localhost
. This will remove from consideration all (or all but one) firewalls.
â Mark Plotnick
Mar 23 at 0:00
 |Â
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to connect to my Redhat AWS instance with a port other than 22.
This command works: ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
The second command outputs:
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to X.X.X.X port 8157.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file my.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file my.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
but then just hangs. On the server I'm trying to connect to, however, when I run nc -l 8157
I can see
SSH-2.0-OpenSSH_7.6
If I take out the -vvv
part I just get a quick "Connection refused" error.
When I log into the machine and run ssh -p 8157 -vvv ec2-user@localhost
I get the following output:
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "localhost" port 8157
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 8157.
debug1: connect to address 127.0.0.1 port 8157: Connection refused
ssh: connect to host localhost port 8157: Connection refused
Any idea what's going on?
ssh openssh
I'm trying to connect to my Redhat AWS instance with a port other than 22.
This command works: ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
The second command outputs:
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to X.X.X.X port 8157.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file my.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file my.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
but then just hangs. On the server I'm trying to connect to, however, when I run nc -l 8157
I can see
SSH-2.0-OpenSSH_7.6
If I take out the -vvv
part I just get a quick "Connection refused" error.
When I log into the machine and run ssh -p 8157 -vvv ec2-user@localhost
I get the following output:
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "localhost" port 8157
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 8157.
debug1: connect to address 127.0.0.1 port 8157: Connection refused
ssh: connect to host localhost port 8157: Connection refused
Any idea what's going on?
ssh openssh
edited Mar 23 at 14:48
Vlastimil
6,3661146117
6,3661146117
asked Mar 22 at 23:11
user554481
1035
1035
Have you opened up the firewall or changed the AWS security policies to allow access to that port?
â GracefulRestart
Mar 22 at 23:24
If you login to the AWS system and then runssh ... ec2-user@localhost
, does that work?
â Mark Plotnick
Mar 22 at 23:24
@GracefulRestart Yes, I've opened up the security group on the instance. I've also checked the VPC flow logs and I can see my source and target IP and the 8157 port showing up as "ACCEPT OK", so I don't think it's an AWS firewall issue. Also, if the security group were the issue I wouldn't be able to establish a connect at all, right? The ssh verbose command saysConnection established
, so I think it's getting through, it's just not finishing.
â user554481
Mar 22 at 23:35
@MarkPlotnick What could go in the. . .
? I didn't know you could connect to localhost. I'm guessing I would just dossh -p 8157 ec2-user@localhost
?
â user554481
Mar 22 at 23:37
Same command -ssh -i my.pem -p 8157 -vvv ec2-user@localhost
. This will remove from consideration all (or all but one) firewalls.
â Mark Plotnick
Mar 23 at 0:00
 |Â
show 1 more comment
Have you opened up the firewall or changed the AWS security policies to allow access to that port?
â GracefulRestart
Mar 22 at 23:24
If you login to the AWS system and then runssh ... ec2-user@localhost
, does that work?
â Mark Plotnick
Mar 22 at 23:24
@GracefulRestart Yes, I've opened up the security group on the instance. I've also checked the VPC flow logs and I can see my source and target IP and the 8157 port showing up as "ACCEPT OK", so I don't think it's an AWS firewall issue. Also, if the security group were the issue I wouldn't be able to establish a connect at all, right? The ssh verbose command saysConnection established
, so I think it's getting through, it's just not finishing.
â user554481
Mar 22 at 23:35
@MarkPlotnick What could go in the. . .
? I didn't know you could connect to localhost. I'm guessing I would just dossh -p 8157 ec2-user@localhost
?
â user554481
Mar 22 at 23:37
Same command -ssh -i my.pem -p 8157 -vvv ec2-user@localhost
. This will remove from consideration all (or all but one) firewalls.
â Mark Plotnick
Mar 23 at 0:00
Have you opened up the firewall or changed the AWS security policies to allow access to that port?
â GracefulRestart
Mar 22 at 23:24
Have you opened up the firewall or changed the AWS security policies to allow access to that port?
â GracefulRestart
Mar 22 at 23:24
If you login to the AWS system and then run
ssh ... ec2-user@localhost
, does that work?â Mark Plotnick
Mar 22 at 23:24
If you login to the AWS system and then run
ssh ... ec2-user@localhost
, does that work?â Mark Plotnick
Mar 22 at 23:24
@GracefulRestart Yes, I've opened up the security group on the instance. I've also checked the VPC flow logs and I can see my source and target IP and the 8157 port showing up as "ACCEPT OK", so I don't think it's an AWS firewall issue. Also, if the security group were the issue I wouldn't be able to establish a connect at all, right? The ssh verbose command says
Connection established
, so I think it's getting through, it's just not finishing.â user554481
Mar 22 at 23:35
@GracefulRestart Yes, I've opened up the security group on the instance. I've also checked the VPC flow logs and I can see my source and target IP and the 8157 port showing up as "ACCEPT OK", so I don't think it's an AWS firewall issue. Also, if the security group were the issue I wouldn't be able to establish a connect at all, right? The ssh verbose command says
Connection established
, so I think it's getting through, it's just not finishing.â user554481
Mar 22 at 23:35
@MarkPlotnick What could go in the
. . .
? I didn't know you could connect to localhost. I'm guessing I would just do ssh -p 8157 ec2-user@localhost
?â user554481
Mar 22 at 23:37
@MarkPlotnick What could go in the
. . .
? I didn't know you could connect to localhost. I'm guessing I would just do ssh -p 8157 ec2-user@localhost
?â user554481
Mar 22 at 23:37
Same command -
ssh -i my.pem -p 8157 -vvv ec2-user@localhost
. This will remove from consideration all (or all but one) firewalls.â Mark Plotnick
Mar 23 at 0:00
Same command -
ssh -i my.pem -p 8157 -vvv ec2-user@localhost
. This will remove from consideration all (or all but one) firewalls.â Mark Plotnick
Mar 23 at 0:00
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
This command works:
ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:
ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
Your other side may have opened port in the firewall, but...
Since port 22 works, your server listens on that port.
Re-configure your server to listen on whatever port you wish.
You can do that in the file:
/etc/ssh/sshd_config
With the following setting:
Port 8157
Don't forget to restart your SSH daemon afterwards.
What do you mean by "Re-configure your server to listen on whatever port you wish." Do you mean change the firewall? My AWS security groups (firewall) are completely open. Are you referring to the ssh daemon's ports? If so, how can I change that?
â user554481
Mar 23 at 14:45
@user554481 Suffice that edit?
â Vlastimil
Mar 23 at 14:46
Wow, that worked! Is it not open to all ports by default?
â user554481
Mar 23 at 14:54
@user554481 No, it is not..
â Vlastimil
Mar 23 at 14:55
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
This command works:
ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:
ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
Your other side may have opened port in the firewall, but...
Since port 22 works, your server listens on that port.
Re-configure your server to listen on whatever port you wish.
You can do that in the file:
/etc/ssh/sshd_config
With the following setting:
Port 8157
Don't forget to restart your SSH daemon afterwards.
What do you mean by "Re-configure your server to listen on whatever port you wish." Do you mean change the firewall? My AWS security groups (firewall) are completely open. Are you referring to the ssh daemon's ports? If so, how can I change that?
â user554481
Mar 23 at 14:45
@user554481 Suffice that edit?
â Vlastimil
Mar 23 at 14:46
Wow, that worked! Is it not open to all ports by default?
â user554481
Mar 23 at 14:54
@user554481 No, it is not..
â Vlastimil
Mar 23 at 14:55
add a comment |Â
up vote
1
down vote
accepted
This command works:
ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:
ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
Your other side may have opened port in the firewall, but...
Since port 22 works, your server listens on that port.
Re-configure your server to listen on whatever port you wish.
You can do that in the file:
/etc/ssh/sshd_config
With the following setting:
Port 8157
Don't forget to restart your SSH daemon afterwards.
What do you mean by "Re-configure your server to listen on whatever port you wish." Do you mean change the firewall? My AWS security groups (firewall) are completely open. Are you referring to the ssh daemon's ports? If so, how can I change that?
â user554481
Mar 23 at 14:45
@user554481 Suffice that edit?
â Vlastimil
Mar 23 at 14:46
Wow, that worked! Is it not open to all ports by default?
â user554481
Mar 23 at 14:54
@user554481 No, it is not..
â Vlastimil
Mar 23 at 14:55
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
This command works:
ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:
ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
Your other side may have opened port in the firewall, but...
Since port 22 works, your server listens on that port.
Re-configure your server to listen on whatever port you wish.
You can do that in the file:
/etc/ssh/sshd_config
With the following setting:
Port 8157
Don't forget to restart your SSH daemon afterwards.
This command works:
ssh -i my.pem -p 22 ec2-user@X.X.X.X
But this command does not:
ssh -i my.pem -p 8157 -vvv ec2-user@X.X.X.X
Your other side may have opened port in the firewall, but...
Since port 22 works, your server listens on that port.
Re-configure your server to listen on whatever port you wish.
You can do that in the file:
/etc/ssh/sshd_config
With the following setting:
Port 8157
Don't forget to restart your SSH daemon afterwards.
edited Mar 23 at 14:46
answered Mar 23 at 14:41
Vlastimil
6,3661146117
6,3661146117
What do you mean by "Re-configure your server to listen on whatever port you wish." Do you mean change the firewall? My AWS security groups (firewall) are completely open. Are you referring to the ssh daemon's ports? If so, how can I change that?
â user554481
Mar 23 at 14:45
@user554481 Suffice that edit?
â Vlastimil
Mar 23 at 14:46
Wow, that worked! Is it not open to all ports by default?
â user554481
Mar 23 at 14:54
@user554481 No, it is not..
â Vlastimil
Mar 23 at 14:55
add a comment |Â
What do you mean by "Re-configure your server to listen on whatever port you wish." Do you mean change the firewall? My AWS security groups (firewall) are completely open. Are you referring to the ssh daemon's ports? If so, how can I change that?
â user554481
Mar 23 at 14:45
@user554481 Suffice that edit?
â Vlastimil
Mar 23 at 14:46
Wow, that worked! Is it not open to all ports by default?
â user554481
Mar 23 at 14:54
@user554481 No, it is not..
â Vlastimil
Mar 23 at 14:55
What do you mean by "Re-configure your server to listen on whatever port you wish." Do you mean change the firewall? My AWS security groups (firewall) are completely open. Are you referring to the ssh daemon's ports? If so, how can I change that?
â user554481
Mar 23 at 14:45
What do you mean by "Re-configure your server to listen on whatever port you wish." Do you mean change the firewall? My AWS security groups (firewall) are completely open. Are you referring to the ssh daemon's ports? If so, how can I change that?
â user554481
Mar 23 at 14:45
@user554481 Suffice that edit?
â Vlastimil
Mar 23 at 14:46
@user554481 Suffice that edit?
â Vlastimil
Mar 23 at 14:46
Wow, that worked! Is it not open to all ports by default?
â user554481
Mar 23 at 14:54
Wow, that worked! Is it not open to all ports by default?
â user554481
Mar 23 at 14:54
@user554481 No, it is not..
â Vlastimil
Mar 23 at 14:55
@user554481 No, it is not..
â Vlastimil
Mar 23 at 14:55
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%2f432962%2fssh-connection-refused-stuck-at-debug1-local-version-string%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
Have you opened up the firewall or changed the AWS security policies to allow access to that port?
â GracefulRestart
Mar 22 at 23:24
If you login to the AWS system and then run
ssh ... ec2-user@localhost
, does that work?â Mark Plotnick
Mar 22 at 23:24
@GracefulRestart Yes, I've opened up the security group on the instance. I've also checked the VPC flow logs and I can see my source and target IP and the 8157 port showing up as "ACCEPT OK", so I don't think it's an AWS firewall issue. Also, if the security group were the issue I wouldn't be able to establish a connect at all, right? The ssh verbose command says
Connection established
, so I think it's getting through, it's just not finishing.â user554481
Mar 22 at 23:35
@MarkPlotnick What could go in the
. . .
? I didn't know you could connect to localhost. I'm guessing I would just dossh -p 8157 ec2-user@localhost
?â user554481
Mar 22 at 23:37
Same command -
ssh -i my.pem -p 8157 -vvv ec2-user@localhost
. This will remove from consideration all (or all but one) firewalls.â Mark Plotnick
Mar 23 at 0:00