4

My infrastructure is in AWS. I have a bastion instance that I go through to get to an ec2 instance. I'm able to log into it about 95% of the time. I have my IP listed in the ingress rules for the bastion. I've added my key to the ssh agent.

I realize that I never log out when I'm done working, but instead close my laptop. Does it think I'm still logged in, so that's why it's not letting me in again? Is there anyway to clear that?

I'm confused why this keeps happening. Any ideas?

ssh dsutil -vvv
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/me/.ssh/config
debug1: /Users/me/.ssh/config line 5: Applying options for dsutil
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolve_canonicalize: hostname XX.XX.XX.XXX is address
debug1: Setting implicit ProxyCommand from ProxyJump: ssh -vvv -W '[%h]:%p' new-dev-bastion
debug1: Executing proxy command: exec ssh -vvv -W '[XX.XX.XX.XXX]:22' new-dev-bastion
debug1: identity file /Users/me/.ssh/id_rsa type -1
debug1: identity file /Users/me/.ssh/id_rsa-cert type -1
debug1: identity file /Users/me/.ssh/id_dsa type -1
debug1: identity file /Users/me/.ssh/id_dsa-cert type -1
debug1: identity file /Users/me/.ssh/id_ecdsa type -1
debug1: identity file /Users/me/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/me/.ssh/id_ed25519 type -1
debug1: identity file /Users/me/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/me/.ssh/id_xmss type -1
debug1: identity file /Users/me/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/me/.ssh/config
debug1: /Users/me/.ssh/config line 1: Applying options for new-dev-bastion
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolve_canonicalize: hostname X.XX.XXX.XXX is address
debug2: ssh_connect_direct
debug1: Connecting to X.XX.XXX.XXX [X.XX.XXX.XXX] port 22.
debug1: connect to address X.XX.XXX.XXX port 22: Operation timed out
ssh: connect to host X.XX.XXX.XXX port 22: Operation timed out
ssh_exchange_identification: Connection closed by remote host
2

your still logged session shouldn't interfere. Here the problem seems to be the Operation timed out. Can you check if you reach remote port 22? You can use telnet or nc, for example:

nc -zv X.XX.XXX.XXX 22

If it gives you a timeout, then the problem is between your network and the EC2 instance: somewhere you can't reach remote 22 port.
You can then check:

  1. Your network: are you able to reach another 22 port? For example:
    nc -zv portquiz.net 22
    
  2. AWS Security group: is your ip still the same you listed on the ingress rule? Can you temporary open from 0.0.0.0 traffic then try a login?
  3. Bastion server is operational: maybe the server hangs and doesn't answer. Can you ping it? Can you restart it and try a login?
1
  • Ah, it ended up being a VPN issue with my company. I was logged into the VPN, but there's a secondary login that occurs sometimes to actually connect to the internet (usually after restarting the computer, have to do that 2nd login). Once I did that login, I was able to get in. Thanks for helping me troubleshoot.
    – Gerrrald1
    May 5 '20 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.