Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|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

1 Answer 1

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!

share|improve this answer
    
What is the actual problem you're trying to solve that leads you to thinking this is the way to solve it? –  bobmagoo May 22 at 15:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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