0

What if SSH (or maybe even all TCP) access to a EC2 instance is lost?

How to restore root access in this case?

Is there a Linux console in EC2 (provided it runs Linux) similar to console in Digital Ocean?

porton
  • 312
  • 1
  • 14

1 Answers1

1

First you should review the troubleshooting steps here to target common connectivity issues. If that doesn't work you can try to do the following:

  • Start a new Linux instance
  • Stop the instance you are having trouble with
  • Detach the root volume of the broken instance
  • Attach the root volume of the broken instance to the new instance as an additional disk
  • Mount the additional disk and try to troubleshoot what may be wrong.
    • You can look at the user's authorized_keys file (/home/<user>/.ssh/authorized_keys) and verify it matches a working instance's authorized keys in the same location (should contain the public id of your AWS key pair).
    • Review log files for other possible issues
  • Attempt to fix the issue or recover the data you need to spin up a new instance
  • Shutdown down the new instance and detach the volume if you believe you fixed the issue
  • Attach the volume to the old instance
  • Try to launch again
B. Miller
  • 697
  • 3
  • 9