Comment 0 for bug 1557380

Revision history for this message
Nick Veitch (evilnick) wrote :

e.g.:

Usage: juju add-ssh-key <ssh-key>

Summary:
Adds a the provided public SSH key to a model and all currently deployed units within that model.

Options:

-m, --model (= "")
  Model to operate in

Details:
Juju maintains a per-model cache of public SSH keys which it copies to each unit. By default this includes the key of the user who created the model (assuming it is stored in the default location ~/.ssh/). Additional keys may be added with this command, quoting the entire public key as an argument.

Examples:

    juju add-ssh-key "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCygc6Rc9XgHdhQqTJ
    Wsoj+I3xGrOtk21xYtKikGqItAHmrE5+VH6PY1rVIUXhpTgpSkJsHLmhE29OhIpt8vQSOCh+0
    qYfS5LieM79HIOJEgJEzIqC52rCYXLvr/BVkd4IoM1vpb/n6u9o8v1a0VUGfc/J6tQAcPRExz
    jZUVs8HdLtcFq4JLYC41miiJtHw4b3qYu7qm3vh4eCiK1LqLncXnBCJ0pADXaL5OQ9dmD3aCb
    i8KFyOEs3UumPosgmhVCAHObWHwNQ/ZU2KrX1/lv/+lBChx2tJliqQpyYMiA3nrtSjfq3AF1r
    QgZVF5vz8LESQbGc6+vLcXZ9KQpuYDt joe@ubuntu"

For ease of use, on Ubuntu/CentOS/MacOSX it is possible to use shell substitution
to pass the key to the command:

    juju add-ssh-key $(cat ~/mykey.pub)

See also: list-ssh-key
          remove-ssh-key
          import-ssh-key