Skip to content

Commit

Permalink
add onessh-copy-id
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime Melis committed Jul 13, 2012
1 parent 3848a3d commit b47a3a3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -16,6 +16,7 @@ Commands
- [__onedeploy__](#onedeploy): Creates and deploys instantaneously a Virtual Machine.
- [__onereport__](#onereport): Displays a summary of running VMs.
- [__onessh__](#onessh): SSH's into a running VM.
- [__onessh-copy-id__](#onessh-copy-id): Copies public key to a running VM.
- [__onevnc__](#onevnc): Opens the VNC console of a running VM.
- [__oneirb__](#oneirb): Opens an IRB session with all the OpenNebula libraries.
- [__oneconf__](#oneconf): Modifies the default configuration files.
Expand Down Expand Up @@ -76,6 +77,14 @@ SSH's into a running VM:

$ onessh 9 -l root

onessh-copy-id
--------------

Copies the public key to a running VM identified by ID or by name. If a second parameter is passwd to the script, it will be used as the username.

$ onessh-copy-id 9
$ onessh-copy-id 9 root

onevnc
------

Expand Down
12 changes: 12 additions & 0 deletions onessh-copy-id
@@ -0,0 +1,12 @@
#!/bin/bash

VM=$1
USER=$2
[ -n "$USER" ] && USER="$USER@"

IP=$(onevm show $VM|grep IP=|grep -Eo '[0-9.]+'|head -n 1)


ssh-copy-id "${USER}${IP}"


0 comments on commit b47a3a3

Please sign in to comment.