11

I need to send a public key to an EC2, without use the ec2-* api commands, and I can't.

I've tried scp and ssh-copy-id, but booth can't use the -i parameter to connect using the keypairs.

The ssh-copy-id -i parameter are the file (public key) to be sent.

What can I do to upload it?

1 Answers1

13

Ok! I found an way.

In the client side:

cat ~/.ssh/id_rsa.pub | ssh -i aws.pem ubuntu@ip_address "cat - >> ~/.ssh/authorized_keys2"

All done!