Skip to content

Commit

Permalink
Merge pull request #55 from lilyLuLiu/main
Browse files Browse the repository at this point in the history
fix error when connect bastion without key
  • Loading branch information
lilyLuLiu authored Oct 29, 2024
2 parents 8fb62ec + b7bfa4c commit 84fef22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/common/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ Host proxy_host
StrictHostKeyChecking no
HostName ${BASTION_HOST}
User ${BASTION_HOST_USERNAME}
IdentityFile ${BASTION_HOST_KEY_PATH}
Host target_host
HostName ${TARGET_HOST}
User ${TARGET_HOST_USERNAME}
IdentityFile ${TARGET_HOST_KEY_PATH}
ProxyJump proxy_host
EOF
if [[ -z ${TARGET_HOST_KEY_PATH+x} ]]; then
sed -i"" -e '9d' ssh_config
if [[ -n ${TARGET_HOST_KEY_PATH+x} ]]; then
sed -i"" -e "11 i\ IdentityFile $TARGET_HOST_KEY_PATH" ssh_config
fi
if [[ -z ${BASTION_HOST_KEY_PATH+x} ]]; then
sed -i"" -e '4d' ssh_config
if [[ -n ${BASTION_HOST_KEY_PATH+x} ]]; then
sed -i"" -e "5 i\ IdentityFile ${BASTION_HOST_KEY_PATH}" ssh_config
fi
cat ssh_config
}
Expand Down

0 comments on commit 84fef22

Please sign in to comment.