0

At AWS cloud platform, I provisioned a bastion host and ec2 instances. I would like to login to ec2 instances from the bastion host using ssh agent forwarding. It is not working. Here is what I've done.

  1. At my local ubuntu laptop:
cat ~/.ssh/config
Host *
 ForwardAgent yes
  1. start the ssh-agent
eval `ssh-agent`
  1. login to bastion host
ssh -A -i key.pem [email protected]
  1. I successfully logged into bastion host.
  2. At the bastion host, login to an ec2 instance. I got permission denied.
ssh -A 10.1.11.21
[email protected]: Permission denied (publickey).
  1. I copied key.pem to the bastion host. With the key.pem, I am able to login to ec2 instance from bastion host. At the bastion host,
ssh -i key.pem 10.1.11.21

I prefer not to copy key.pem to every ec2 instance. How to solve the problem?

1 Answer 1

0

you can try the following and then retry to connect using the same key file : chmod 400 key.pem

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .