question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to ssh from an ec2 instance

See original GitHub issue

I tried accessing play-with-docker instance using ssh from ec2 instance (can’t do from my local machine because of firewall blocking port 22). I checked the outbound rules but all ports are open.

Following error shows up when I try to ssh a pwd machine,

Permission denied (publickey).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
marcosnilscommented, Mar 12, 2018

This is because you need to generate a key locally to connect. Try with ssh-keygen

0reactions
aleskxyzcommented, Jan 6, 2020

Nice. Would be nice if you can share here so others don’t have the same issue.

I don’t know whats goes on exactly, but I edited “/etc/ssh/sshd_config” in the node to enable root authentication with password and permit port forwarding and reset root password. Those changes didn’t let me to authenticate neither with password nor publickey. Then I rollback my changes, but no success. It seems those changes had a permanent effect on ssh service. Finally I test a new node without any modification and everything was ok.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve "Connection refused" or "Connection timed out ... - AWS
Error message: "ssh: connect to host ec2-X-X-X-X.compute-1.amazonaws.com port 22: Connection refused". This message comes remotely from a host.
Read more >
Can't SSH into AWS EC2 instance - Stack Overflow
I can't SSH into my EC2 instances - I am getting a timeout error. I checked the security groups to ensure that SSH...
Read more >
Why can't I ssh into my new EC2 Instance? - Server Fault
This has been happening to me on some of my EC2 boxes. In general, it appears that if a process ...
Read more >
Unable To Connect Your EC2 Instance Using SSH? - Medium
Select The EC2 Instance that you want connect from SSH. 3.Select the Security group for the EC2 Instance that we are trying to...
Read more >
How to troubleshoot SSH connection issues with AWS EC2.
If your EC2 instance is running and trying to SSH with correct IP (there will be a change in IP after each restart),...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found