check out screen - that is a "text mode window manager" ... read the man page, it should be possible to start screen and immediately load your miner.
something like "screen -S mine ./miner.sh" opens a window named "mine" and starts the script "miner.sh" ... you should now be able to ssh and attach to the session with "screen -x mine"
"Ctrl-a d" detaches the session - your shell script continues to run ...