From f945e19efb2c6bd4a951a23b7f93005c719fa3f5 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 22 Feb 2019 17:05:11 +0100 Subject: [PATCH] copie de la bonne clef sur les noeuds --- scripts/onehost_create_all | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/onehost_create_all b/scripts/onehost_create_all index a06fa83..35fe5db 100755 --- a/scripts/onehost_create_all +++ b/scripts/onehost_create_all @@ -7,23 +7,23 @@ . /usr/lib/eole/ihm.sh # -# NAME: copy_ssh_id +# NAME: copy_ssh_id # AIM: Copy the ssh key on the host -# PARAM: the hostname of the node +# PARAM: the hostname of the node # function copy_ssh_id() { - local ip=${1} + local host=${1} - ssh ${ip} bash -s < /tmp/one-master.key.pub -if ! grep -qs /tmp/one-master.key.pub ~oneadmin/.ssh/authorized_keys + CLEF=$(cat ~oneadmin/.ssh/id_rsa.pub) + ssh ${host} bash -s <> ~oneadmin/.ssh/authorized_keys + echo $CLEF >> ~oneadmin/.ssh/authorized_keys chown oneadmin:oneadmin ~oneadmin/.ssh/authorized_keys fi -rm -f /tmp/one-master.key.pub EOF + su - oneadmin -c "ssh-keyscan $host" return ${?} } @@ -42,7 +42,7 @@ function register_node() # # NAME: wait_node_ok # AIM: Wait until the node is OK or ERROR -# PARAM: The node name +# PARAM: The node name # function wait_node_ok() {