Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add onessh-copy-id

  • Loading branch information...
commit b47a3a389252446e2089d188e548369a7dfba502 1 parent 3848a3d
@jmelis jmelis authored
Showing with 21 additions and 0 deletions.
  1. +9 −0 README.md
  2. +12 −0 onessh-copy-id
View
9 README.md
@@ -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.
@@ -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
------
View
12 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}"
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.