I am trying to create a single script that starts an ssh session, and execute commands on the remote machine, then backgrounds the session. So far I've been playing with the -f or -f -N options, but I don't know how to bring the session back to the foreground to verify my commands executed correctly.
Or is there a way that a single script can start the ssh session and continue inputting commands to that newly opened session? and then background that session? If none of those work I was thinking another way of doing this is a script that starts an ssh session, upload and execute the commands via another script.
any ideas on how to do this.