I have a script when I use multiple ssh connections inside HEREDOC, like so:
ssh -A -tt -l user 192.168.1.2 <<EOF ping server1 -c3 ssh server2 nslookup www.gogole.com exit ssh server3 ifconfig exit EOF
however, when I use exit inside EOF, it stops processing script instead of exiting SSH session, any idea/trick how I can exit ssh session instead of the whole script ?
#'~.' - terminate session - doesn't work unfortunately