How To Set Up SSH Keys for Juju?

Asked by nutznboltz on 2011-09-28


$ lsb_release -ds
Ubuntu 11.04

$ uname -rsnvp
Linux juju 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011 x86_64

$ dpkg -l juju | tail -1
ii juju 0.5+bzr363-1juju1~natty1 Cloud automation and orchestration

AWS works:
$ ec2-run-instances ami-06ad526f -k ${EC2_KEYPAIR} -t t1.micro
RESERVATION r-d6dc1fb8 291678989163 default
INSTANCE i-06e88066 ami-06ad526f pending ec2-keypair 0 t1.micro 2011-09-28T12:17:46+0000 us-east-1b aki-407d9529 monitoring-disabled ebs paravirtual

$ ec2-terminate-instances i-06e88066
INSTANCE i-06e88066 running shutting-down


juju fails:

$ ls ~/.ssh/
authorized_keys known_hosts

$ juju bootstrap
2011-09-28 08:24:04,511 INFO Bootstrapping environment 'sample' (type: ec2)...
SSH authorized/public key not found.
2011-09-28 08:24:05,063 ERROR SSH authorized/public key not found.


How to set up SSH keys for juju?

Question information

English Edit question
Ubuntu ensemble Edit question
No assignee Edit question
Solved by:
Clint Byrum
Last query:
Last reply:

Tried with ECDSA keys and it failed:

ssh-keygen -t ecdsa

apt-get install keychain
source /home/nutz/.keychain/juju-sh
Enter passphrase for /home/nutz/.ssh/id_ecdsa:
Identity added: /home/nutz/.ssh/id_ecdsa (/home/nutz/.ssh/id_ecdsa)

$ juju bootstrap
2011-09-28 08:53:52,091 INFO Bootstrapping environment 'sample' (type: ec2)...
SSH authorized/public key not found.
2011-09-28 08:53:52,685 ERROR SSH authorized/public key not found.

Plus I get mixed messages when I destroy the environment and it leaves security groups behind in my AWS.

$ juju destroy-environment
WARNING: this command will destroy the 'sample' environment (type: ec2).
This includes all machines, services, data, and other resources. Continue [y/N]y
2011-09-28 09:01:18,632 INFO Destroying environment 'sample' (type: ec2)...
2011-09-28 09:01:19,346 INFO Waiting on 1 EC2 instances to transition to terminated state, this may take a while
2011-09-28 09:01:45,066 ERROR Instance shutdown taking too long, could not delete groups juju-sample-0
2011-09-28 09:01:45,247 INFO 'destroy_environment' command finished successfully

Best Clint Byrum (clint-fewbar) said : #3

nutznboltz, to setup SSH keys for use with juju run

ssh-keygen -t rsa -b 2048

Thanks Clint Byrum, that solved my question.