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?

link|improve this question
scp does support -i. What command did you try to run and what's the output? – dfranke Nov 15 '10 at 3:46
I'm also not clear on exactly what you're trying to do. Are you trying to launch an instance with an ssh key that you generated locally, or do you have an already-running instance that you're trying to install a second key onto? – dfranke Nov 15 '10 at 3:47
dfranke. I can connect to the instance at this time, using ssh -i file.pem. But I need make a cron in the client side with rsync, then, I need to have acess withou autentication. – TiagoGouvea Nov 15 '10 at 12:32
I create the public keys in the client side but I can't send it to server. It's the only problem. How to send my public keys from client to server. :( I think it's simple, but at this time I can't. – TiagoGouvea Nov 15 '10 at 12:34
feedback

1 Answer

Ok! I found an way.

In the client side:

cat /home/tiago/.ssh/id_dsa.pub | ssh -i /home/tiago/.ssh/aprimorar.pem ubuntu@ec2-72-44-49-239.compute-1.amazonaws.com "cat - >> ~/.ssh/authorized_keys2"

All done!

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.