pmialon at linagora.com
2009-Sep-08 15:34 UTC
[Ovirt-devel] [PATCH node-image] Add ability to set persistent ssh_host_keys on the node, usefull if you run diskless instance of ovirt-node
From: root <root at chappy.(none)> --- ovirt-node-image.ks | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/ovirt-node-image.ks b/ovirt-node-image.ks index 802b6a5..d698497 100644 --- a/ovirt-node-image.ks +++ b/ovirt-node-image.ks @@ -55,6 +55,22 @@ if [ -f "ovirt-authorized_keys" ]; then chmod 644 $INSTALL_ROOT/root/.ssh/authorized_keys fi +if [ -f ovirt-ssh_host_dsa_key -f ovirt-ssh_host_dsa_key.pub \ + -f ovirt-ssh_host_key -f ovirt-ssh_host_key.pub \ + -f ovirt-ssh_host_rsa_key -f ovirt-ssh_host_rsa_key.pub ]; then + echo "Adding persistent ssh_keys for host to Image" + mkdir -p $INSTALL_ROOT/etc/ssh + cp -v ovirt-ssh_host_dsa_key $INSTALL_ROOT/etc/ssh/ssh_host_dsa_key + cp -v ovirt-ssh_host_key $INSTALL_ROOT/etc/ssh/ssh_host_key + cp -v ovirt-ssh_host_rsa_key $INSTALL_ROOT/etc/ssh/ssh_host_rsa_key + cp -v ovirt-ssh_host_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_key.pub + cp -v ovirt-ssh_host_dsa_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_dsa_key.pub + cp -v ovirt-ssh_host_rsa_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_rsa_key.pub + chown root:root $INSTALL_ROOT/etc/ssh/*key* + chmod 600 $INSTALL_ROOT/etc/ssh/*key + chmod 644 $INSTALL_ROOT/etc/ssh/*key.pub +fi + echo "Fixing boot menu" # remove quiet from Node bootparams, added by livecd-creator sed -i -e 's/ quiet//' $LIVE_ROOT/isolinux/isolinux.cfg -- 1.6.2.5
Pierre-Gilles Mialon
2009-Sep-08 16:10 UTC
[Ovirt-devel] [PATCH node-image] Add ability to set persistent ssh_host_keys on the node, usefull if you run diskless instance of ovirt-node
Sorry for that I didn't send the good patch. Please forget this mail and the precedent Sincerely, Le mardi 8 septembre 2009 17:34:56 pmialon at linagora.com, vous avez ?crit :> From: root <root at chappy.(none)> > > --- > ovirt-node-image.ks | 16 ++++++++++++++++ > 1 files changed, 16 insertions(+), 0 deletions(-) > > diff --git a/ovirt-node-image.ks b/ovirt-node-image.ks > index 802b6a5..d698497 100644 > --- a/ovirt-node-image.ks > +++ b/ovirt-node-image.ks > @@ -55,6 +55,22 @@ if [ -f "ovirt-authorized_keys" ]; then > chmod 644 $INSTALL_ROOT/root/.ssh/authorized_keys > fi > > +if [ -f ovirt-ssh_host_dsa_key -f ovirt-ssh_host_dsa_key.pub \ > + -f ovirt-ssh_host_key -f ovirt-ssh_host_key.pub \ > + -f ovirt-ssh_host_rsa_key -f ovirt-ssh_host_rsa_key.pub ]; then > + echo "Adding persistent ssh_keys for host to Image" > + mkdir -p $INSTALL_ROOT/etc/ssh > + cp -v ovirt-ssh_host_dsa_key $INSTALL_ROOT/etc/ssh/ssh_host_dsa_key > + cp -v ovirt-ssh_host_key $INSTALL_ROOT/etc/ssh/ssh_host_key > + cp -v ovirt-ssh_host_rsa_key $INSTALL_ROOT/etc/ssh/ssh_host_rsa_key > + cp -v ovirt-ssh_host_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_key.pub > + cp -v ovirt-ssh_host_dsa_key.pub > $INSTALL_ROOT/etc/ssh/ssh_host_dsa_key.pub + cp -v > ovirt-ssh_host_rsa_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_rsa_key.pub > + chown root:root $INSTALL_ROOT/etc/ssh/*key* > + chmod 600 $INSTALL_ROOT/etc/ssh/*key > + chmod 644 $INSTALL_ROOT/etc/ssh/*key.pub > +fi > + > echo "Fixing boot menu" > # remove quiet from Node bootparams, added by livecd-creator > sed -i -e 's/ quiet//' $LIVE_ROOT/isolinux/isolinux.cfgPierre-Gilles Mialon Responsable h?bergement :: Head of Hosting services pmialon at linagora.com :: +33.1 58 18 65 46 Linagora :: http://www.linagora.com 27 rue de Berri :: 75008 PARIS -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090908/11a7ddd1/attachment.sig>
Darryl L. Pierce
2009-Sep-10 13:14 UTC
[Ovirt-devel] [PATCH node-image] Add ability to set persistent ssh_host_keys on the node, usefull if you run diskless instance of ovirt-node
On Tue, Sep 08, 2009 at 03:34:56PM +0000, pmialon at linagora.com wrote:> From: root <root at chappy.(none)> > > --- > ovirt-node-image.ks | 16 ++++++++++++++++ > 1 files changed, 16 insertions(+), 0 deletions(-) > > diff --git a/ovirt-node-image.ks b/ovirt-node-image.ks > index 802b6a5..d698497 100644 > --- a/ovirt-node-image.ks > +++ b/ovirt-node-image.ks > @@ -55,6 +55,22 @@ if [ -f "ovirt-authorized_keys" ]; then > chmod 644 $INSTALL_ROOT/root/.ssh/authorized_keys > fi > > +if [ -f ovirt-ssh_host_dsa_key -f ovirt-ssh_host_dsa_key.pub \ > + -f ovirt-ssh_host_key -f ovirt-ssh_host_key.pub \ > + -f ovirt-ssh_host_rsa_key -f ovirt-ssh_host_rsa_key.pub ]; then > + echo "Adding persistent ssh_keys for host to Image" > + mkdir -p $INSTALL_ROOT/etc/ssh > + cp -v ovirt-ssh_host_dsa_key $INSTALL_ROOT/etc/ssh/ssh_host_dsa_key > + cp -v ovirt-ssh_host_key $INSTALL_ROOT/etc/ssh/ssh_host_key > + cp -v ovirt-ssh_host_rsa_key $INSTALL_ROOT/etc/ssh/ssh_host_rsa_key > + cp -v ovirt-ssh_host_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_key.pub > + cp -v ovirt-ssh_host_dsa_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_dsa_key.pub > + cp -v ovirt-ssh_host_rsa_key.pub $INSTALL_ROOT/etc/ssh/ssh_host_rsa_key.pub > + chown root:root $INSTALL_ROOT/etc/ssh/*key* > + chmod 600 $INSTALL_ROOT/etc/ssh/*key > + chmod 644 $INSTALL_ROOT/etc/ssh/*key.pub > +fi > + > echo "Fixing boot menu" > # remove quiet from Node bootparams, added by livecd-creator > sed -i -e 's/ quiet//' $LIVE_ROOT/isolinux/isolinux.cfg > -- > 1.6.2.5ACK. This works as expected. I copied the SSH keys for my laptop into my build environment, then built and installed a managed node. I was able to SSH into the node without a password prompt. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ Is fearr Gaeilge bhriste n? B?arla cliste. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090910/e09b72c1/attachment.sig>