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 [email protected]
But this command does not:ssh -i my.pem -p 8157 -vvv [email protected]
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 ... ec2-user@localhost
, does that work?Connection established
, so I think it's getting through, it's just not finishing.. . .
? I didn't know you could connect to localhost. I'm guessing I would just dossh -p 8157 ec2-user@localhost
?ssh -i my.pem -p 8157 -vvv ec2-user@localhost
. This will remove from consideration all (or all but one) firewalls.