It's possible.
But you would have to compile the entire bash shell into your app, as the iPhone OS doesn't allow any new processes to be launched or run. So bash would have to be part of your app (as would any other utilities you would want to run. If you wanted ssh, you would have to compile all of it as a subroutine in your app's process space).
The Simulator is inaccurate in that it doesn't enforce the security on an app's sandbox.