Skip to content

Commit 7c8eb75

Browse files
authored
Remove explicit SSH keyfile from ssh commands (#48)
1 parent cd9ca45 commit 7c8eb75

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

user_scripts/cluster_down.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export CLUSTER=$(eval "${COMMAND}")
3535
echo "${CLUSTER}" | jq
3636

3737
# Delete the SSH key file from the bastion host
38-
if ssh -i ~/.ssh/id_rsa_aws [email protected] test -f "~/.ssh/${SSH_KEY_FILE}"
38+
if ssh [email protected] test -f "~/.ssh/${SSH_KEY_FILE}"
3939
then
40-
ssh -i ~/.ssh/id_rsa_aws [email protected] "rm ~/.ssh/${SSH_KEY_FILE}"
41-
ssh -i ~/.ssh/id_rsa_aws [email protected] "rm ~/.ssh/${SSH_KEY_FILE}_admin"
40+
ssh [email protected] "rm ~/.ssh/${SSH_KEY_FILE}"
41+
ssh [email protected] "rm ~/.ssh/${SSH_KEY_FILE}_admin"
4242
echo "SSH keyfiles deleted from bastion host"
4343
export IP_ADDR=$(cat ${SSH_KEY_FILE}_ip)
44-
ssh -i ~/.ssh/id_rsa_aws [email protected] "ssh-keygen -R ${IP_ADDR}"
44+
ssh [email protected] "ssh-keygen -R ${IP_ADDR}"
4545
rm -rf ${SSH_KEY_FILE}_ip
4646
echo "Head node keys deleted from bastion host's known_hosts"
4747
fi

user_scripts/cluster_status.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export IP_ADDR=$(echo $CLUSTER_STATUS | jq -r '.headNode | .privateIpAddress')
4343
if [[ -n "$IP_ADDR" && "$IP_ADDR" != 'null' ]]
4444
then
4545
# Check if secret key already copied
46-
if ssh -i ~/.ssh/id_rsa_aws [email protected] test -f "~/.ssh/${SSH_KEY_FILE}"
46+
if ssh [email protected] test -f "~/.ssh/${SSH_KEY_FILE}"
4747
then
4848
echo "Head node is ready and secret key is already copied"
4949
else
5050
echo "Head node is ready, copying secret key..."
51-
scp -i ~/.ssh/id_rsa_aws ${SSH_KEY_FILE} [email protected]:~/.ssh
52-
scp -i ~/.ssh/id_rsa_aws ${SSH_KEY_FILE}_admin [email protected]:~/.ssh
51+
scp ${SSH_KEY_FILE} [email protected]:~/.ssh
52+
scp ${SSH_KEY_FILE}_admin [email protected]:~/.ssh
5353
echo "Saving head node IP in ${SSH_KEY_FILE}_ip"
5454
echo $IP_ADDR > ${SSH_KEY_FILE}_ip
5555
fi

0 commit comments

Comments
 (0)