I have a machine which I cannot ssh into. I would like to be able to have controll a shell session in it. Is there some way to have it connect out to another machine and for me to issue commands on the server machine that are ran on the client machine?
You can if you're able to set up a reverse ssh session.
Use the following to set up the reverse port forwarding on the machine you can't access (i.e. you have to do this once on that machine)
and then whenever you want from your home machine:
will connect to the machine you couldn't access.
If you can run web application scripts on the machine, I would recommend setting up a secure set of scripts that are triggered via HTTPS - perhaps from a custom menu. Most scripting languages including PHP, Python and PERL, Lua, Ruby, etc. are able to run OS level commands.
Indeed, this is how Webmin works - except it goes even further. It creates it's own web server.
I've done this in the past to deal with the issue you highlight.
You can also go further if you can get the machine to talk to a mail server - I would generally set aside an IMAP mail account. Then you can set up a script that checks the mailbox for specifically formatted emails periodically.