Skip to content

Commit 9724aa2

Browse files
Update connect.sh
1 parent 82ae692 commit 9724aa2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/bastion/scripts/connect.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ ssh_proxy_command_option="ProxyCommand sh -c \"aws ssm start-session --target %h
8888
if [[ -z "$tunnel" ]]; then
8989
echo "Connecting to Bastion host using SSH through Session Manager..."
9090
ssh -i "$SSH_KEY_PATH" -o "$ssh_proxy_command_option" "$BASTION_USER@$instance_id"
91-
echo "Connection to Bastion host established."
9291
exit 0
9392
fi
9493

@@ -97,8 +96,8 @@ if [[ -n "$tunnel_target_user" && -n "$tunnel_target_key" ]]; then
9796
tunnel_host=$(echo "$tunnel" | cut -d':' -f2)
9897
ssh_proxy_command_option="ProxyCommand ssh -i $tunnel_target_key -W %h:%p $tunnel_target_user@$tunnel_host"
9998
ssh_tunnel_proxy_command_option="ProxyCommand ssh -i $tunnel_target_key -W %h:%p $tunnel_target_user@$tunnel_host"
100-
ssh -i "$SSH_KEY_PATH" -o "$ssh_proxy_command_option" -L "$tunnel" -o "$ssh_tunnel_proxy_command_option" -N "$BASTION_USER@$instance_id"
99+
ssh -i "$SSH_KEY_PATH" -o "$ssh_proxy_command_option" -L "$tunnel" -o "$ssh_tunnel_proxy_command_option" -N "$BASTION_USER@$instance_id" &
101100
else
102-
ssh -i "$SSH_KEY_PATH" -o "$ssh_proxy_command_option" -L "$tunnel" -N "$BASTION_USER@$instance_id"
101+
ssh -i "$SSH_KEY_PATH" -o "$ssh_proxy_command_option" -L "$tunnel" -N "$BASTION_USER@$instance_id" &
103102
fi
104103
echo "Tunnel established through Bastion host."

0 commit comments

Comments
 (0)