In your command to connect the iPhone through ssh, You fail to daemonize it with the & sign, so it stays running within the terminal. Even if you did daemonize it, you could lookup the PID with ps -aux | grep ssh, and connect to the process for example with strace. I think there would even be a way of reattaching to the process, although I have no time now to look that up on the net.
Before i continue... i want you to understand, the thief has NO ACCESS to your home server... the ports are tunneled, and the "login" is closed, as long as you use my background commands... you can even close the terminal, the thief has no way of knowing its connected (unless this becomes more popular)...
BUT lets say HE DOES KNOW, what could he do? what would I do? I being the thief would go into the mobileterminal (because if you have changed your root/mobile passwords, he would not be able to "ssh" into the phone via wifi) and type netstat...
netstat DOES give this information...
[Established] state tp4 iPhoneIPaddress - MyHomeIPaddress.Port (stays established even if localhost is not in use)
AND A BUNCH OF OTHER CONNECTIONS WITH SAME FORMAT
so, because i have my ssh server on non-default port, all he would know is that the phone is connected to (Blank) IP address on a (Blank) port..
Now, dont get on a rant about what someone could do with your IP address, because thats just one of many connections and IP's listed... and when on a non-default port he has no idea what protocol is being used or if that IP is really owners... of course he could continue to port scan/who.is the ip, but still, i dont see this is a vulnerability... when my iphone gets lost/stolen, I wont let more than 5 minutes pass before im logged onto it looking at what there doing or tracking their position... and of course, i could close the connection at any time / change passphraze/dsa/rsa's and he never has access again. He would have to do all damage within a half an hour TOPS assuming he gets in without knowing any passwords or keys...
Again, he would have to know a heck of alot about terminal commands just to get AN IP ADDRESS (still not knowing what it belongs to), lol, and i dont think any linux/mac geeks are going to be STEALING iphones from people like me...
On the note of terminal:
My new commands include the "background" version, which will sign out of the computer's ssh and even attach to something that isnt the "terminal"...
How i tested this... ran reverse background command from iphone:
ssh User@name -f -N -R 1201:localhost:5900
once i enter my private dsa key passphrase (which you can require on your phone via the sshd_config file) the terminal goes back to iphone root... i can then further more "exit" every terminal (4 built in) and then [EXIT] the app completely by giving command [EXIT] (not just "exit")..
POINT: With the terminal completely killed/restarted, the connection remained and i was able to connect via my computers localhost...
i dont know what -f -N does that allows it to work outside of the mobileterminal app...
But if i restart my iphone or turn it off, the tunnel is broken... so it would have to be given at each bootup and each change of IP (source).
I appreciate your criticism, but i am a firm believer that some app heads could make this applicable... i know very little about how the OS runs, and even more little about how to write script... so my job here is to get the connection bugz out and do some tests and hand them over to someone els with right know-how.
NOTE: the ONLY time i use an & sign is when using an empty rsa/dsa key and am implicating the
command to a script (do shell script)... but maybe im missing your point...
Here is the thread I started when i realized reverse ssh tunnels could bypass firewalls on the host side:
http://www.macshadows.com/forums/index.php?showtopic=9775
PS: i fiddle with port scanners and using routers against people (people without routers are just retarded)... but i wouldnt call that "hacking", more "snooping".. btw, you joined in jul 2009, your macrumors status is still "newbie"... not implying anything =P
Q: how do i add a command/script to iphone startup?