0

This question already has an answer here:

I had a working EC2 ubuntu instance (t1.micro) connected through an elastic IP, using an Amazon key pair for a passwordless ssh connection. After running fsck like the terminal suggested (wrong move, I know now), the system rebooted and I keep getting "Network Error: Connection Refused" when trying to connect via ssh. I managed to attach the instance's volume to an alternative instance, but I could not see what was wrong. I also tried "ssh -vvv" from an Ubuntu laptop, but got no useful output. Is there a log I can look at to see why ssh is refusing my connection? Is there an alternative way I could debug this?

marked as duplicate by user9517, mdpc, masegaloeh, yagmoth555, HBruijn Aug 23 '16 at 22:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    The logs are in /var/log. – user9517 Aug 15 '16 at 5:41
  • Thanks, but which log to look at? I tried auth.log but without success. – Yuval F Aug 15 '16 at 6:17
  • 1
    @YuvalF auth.log is not interesting in this scenario because the error message you get indicate that the daemon you would connect to has not even started yet. Instead look for /var/log/messages or /var/log/syslog. – kasperd Aug 22 '16 at 20:40
  • Thanks @kasperd. Eventually I bypassed this by creating a new instance. I will keep your suggestion in mind should this happen again. – Yuval F Aug 25 '16 at 4:42
1

It sounds like you did everything right. Did you do an fsck while the volume was mounted from another instance? Perhaps there's just something wrong with the filesystem.

Apparently there's a ec2-get-console-output command now: http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-clt.pdf

I've never used it. But it if you could see the console, you'd hopefully see what's wrong.

Good luck

  • Thanks, I will try fsck from another instance, and will look for the console output. – Yuval F Aug 15 '16 at 6:16

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