aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/cleanup_creds.sh
diff options
context:
space:
mode:
authorwu.zhihui <wu.zhihui1@zte.com.cn>2016-10-22 11:58:03 +0800
committerwu.zhihui <wu.zhihui1@zte.com.cn>2016-10-25 12:43:56 +0800
commit62d00c20476d8e25974c2f78ec9c2bd05d8f2412 (patch)
treeaa1ad21387f45aeb12dcf39bd8f0f295e672530b /scripts/cleanup_creds.sh
parent36f6aa40ca02ef9ef1d24e61af337a960b8a76cd (diff)
Remove Qtip private key files in repos
1. Automaticly genegrate private key files. 2. remove the key files in repo at last. 3. remove public key from authorized_keys of compute hosts. JIRA: QTIP-110 Change-Id: Ie22f3f195edf650e690a2ed69df1af191953068f Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'scripts/cleanup_creds.sh')
-rw-r--r--scripts/cleanup_creds.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/cleanup_creds.sh b/scripts/cleanup_creds.sh
new file mode 100644
index 00000000..9bf44305
--- /dev/null
+++ b/scripts/cleanup_creds.sh
@@ -0,0 +1,14 @@
+#! /bin/bash
+
+DEST_IP=$1
+HOSTNAME=$(hostname)
+sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
+
+case "$INSTALLER_TYPE" in
+ fuel)
+ ssh $sshoptions -i ./config/QtipKey root@$DEST_IP "sed -i '/root@$HOSTNAME/d' /root/.ssh/authorized_keys"
+ ;;
+esac
+
+
+