0

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?

Yuval F
  • 103
  • 6
  • 2
    The logs are in /var/log. – user9517 Aug 15 '16 at 05:41
  • Thanks, but which log to look at? I tried auth.log but without success. – Yuval F Aug 15 '16 at 06: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 04:42

1 Answers1

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

Ryan Babchishin
  • 6,160
  • 2
  • 16
  • 36