From: beierlm Date: Tue, 18 Jan 2022 17:52:23 +0000 (-0500) Subject: Bug 1864 Use private key X-Git-Tag: v12.0.0rc1~57 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F11531%2F2;p=osm%2Fdevops.git Bug 1864 Use private key Changes script to place the private key into the ssh config instead of public key. Fixes bug 1864 Change-Id: I2d5204970ebea62aded6fe125b474032d8fb5d34 Signed-off-by: beierlm --- diff --git a/tools/debug/charmed/generate_ssh_config.sh b/tools/debug/charmed/generate_ssh_config.sh index 6749dd7f..58d06861 100755 --- a/tools/debug/charmed/generate_ssh_config.sh +++ b/tools/debug/charmed/generate_ssh_config.sh @@ -23,10 +23,10 @@ MODULES="lcm pol mon ro nbi" -PUBLIC_KEY=${1:-$HOME/.ssh/id_rsa.pub} -echo "Using $PUBLIC_KEY key." -[ -f $PUBLIC_KEY ] || (echo "$PUBLIC_KEY file does not exist" && exit 1) -PUBLIC_KEY_CONTENT=`cat $PUBLIC_KEY` +PRIVATE_KEY=${1:-$HOME/.ssh/id_rsa} +echo "Using $PRIVATE_KEY key." +[ -f $PRIVATE_KEY ] || (echo "$PRIVATE_KEY file does not exist" && exit 1) +PRIVATE_KEY_CONTENT=`cat $PRIVATE_KEY` mkdir -p ~/.ssh/config.d echo "" | tee ~/.ssh/config.d/osm @@ -40,7 +40,7 @@ for module in $MODULES; do HostName $pod_ip User root # StrictHostKeyChecking no - IdentityFile $PUBLIC_KEY" | tee -a ~/.ssh/config.d/osm + IdentityFile $PRIVATE_KEY" | tee -a ~/.ssh/config.d/osm fi done