-1

How can i ssh on private subnet machine (ec2,10.0.2.241/24) from public subnet machine (ec2,10-0-1-75/24) on same custom VPC (10.0.0.0/20) without usning private key pair (with option proceed without key pair for private subnet machine)?

FYI, I am able to ping private machine from public machine.

[ec2-user@ip-10-0-1-75 .ssh]$ ssh ec2-user@10.0.2.241

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Can anyone please suggest on this?

Rohit Jindal
  • 667
  • 5
  • 13
  • Have you checked if the SSH port is open on the security groups – Rajesh Sep 22 '17 at 15:24
  • @Rajesh - SSH port 22 is open for inbound connection from 10.0.0.0/20 only. – Rohit Jindal Sep 22 '17 at 15:36
  • You will need to authenticate with your instance 10.0.2.241 when trying to SSH. Hopefully this is what is causing the issue. If you are using Putty try using the option "Allow Agent Forwarding" if your key to launch instance 10.0.1.75 and 10.0.2.241 are the same – Rajesh Sep 22 '17 at 15:39

2 Answers2

0

You can use ssh-agent or port forwarding.

jarmod
  • 71,565
  • 16
  • 115
  • 122
0

Network reachability(Ping) and SSH to connect to the EC2 instance is two different things.

You cannot SSH to the private EC2 machine without the key.pem even through a EC2 instance in the same VPC.

Ashan
  • 18,898
  • 4
  • 47
  • 67