I am running a local shell script on the remote Linux system using the following syntax:
ssh -o PubKeyAuthentication=yes -o PreferredAuthentications=publickey username@servername 'bash -s' < localscript.sh
I have not included any exit commands at the end of my script, however when the script is finished executing the ssh connection with the server seems to automatically close. My question is; do I need to include any exit instructions in my script to ensure that sessions are terminated cleanly on the server side?
Many thanks in advance