************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
************************************************** ***************************************
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
The following post was a question that I was asked on another forum, I would like to repost it here:
Quote:
Originally Posted by JSteezy
Michael do u think u cud help me...? I tried making the tunnel wit mobileterminal. I logged into root and typed in
ssh -p 5900 Owner@**.***.***.*** -R 5002: localhost: 23
But it keeps telling me "Bad Remote Forewarding Specification"
I've googled trying to figure out how to fix this but haven't found anything yet.
Any help you cud give me wud be greatly be appreciated...i saw ur videos and it looks like it cud be REALLY useful! One thing that wud help too is if u cud make a video explaining how to set up the tunnel and how to get it working...it wud prolly make this process ten times easier seeing it done.
Thanks,
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
************************************************** ***************************************
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
REPLY FROM ME:
the only reason i didnt make a video with those instructions is because it would show my IP address, so instead i just put the command in the background...
I have to assume you are jailbroken, you have Veency and openSSH installed on your iphone...
YOUR command has many errors... the most obvious being the spaces before and after the localhost, here are the correct commands
Command for forwarding iPhone's VNC server to an SSH server on port 22 (this port 22 can remain default for VNC ONLY):
ssh -p 22 Owner@IPAddress -f -N -R 1201:localhost:5900
THE -f -N will make the reverse connection stay connected (warning, using -f -N will require full restarts on both ends to kill connection) 1201 being the port on your computers localhost and 5900 being the iphone's VNC server that is being forwarded
Command for forwarding iPhone's SSH to an SSH server on port 2222 (Setup SSH server on any other than 22 as to not require root permissions and/or conflict when forwarding same ports) NOTE: this will allow for remote SSHing to your iPhone no matter where it goes.
ssh -p 2222 OwnerIPAddress -f -N -R 1202:localhost:22
1201 being the port you will ssh into on your computers localhost.
Once tunnels are created, use these to connect your computer to its localhost:
Open a VNC Client and use this information
VNC IP: localhost or 127.0.0.1
VNC Port: 1201
VNC Password: (Blank)
Open Terminal and enter this command to ssh to the iPhone:
ssh -p 1202 root@localhost
Hope this helps!
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
************************************************** ***************************************
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
Another user commented on the security of this method, i would like to repost it here:
Quote:
Originally Posted by H2os
Well, I have to say the concept is pretty smart.
But did you think about the consequences?
By setting-up a SSH session to your server / PC you are giving the THIEF ACCESS TO YOUR PC!
Only thing he has to do is start the terminal app and he's on YOUR MACHINE! He can then install some keyloggers, spyware or whatever!
Please be wise, and close or delete this thread. The concept is smart, but it has not been thought over well enough and is NOT SAFE
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
************************************************** ***************************************
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
MY REPLY TO HIS POST:
Please be wise and NEVER ask n e 1 to DELETE/CLOSE their post, especially if you are half retarded.
The Tunnel Command I show above DOES NOT ALLOW THE THEIF TO LOGIN TO YOUR SSH, IT RUNS IT IN THE BACKGROUND OFF OF ROOT... so the theif would need your IP/sshpassword/rootpassword and so on to access your home server... If the theif opens up terminal, he will see the same thing as n e one's iphone... test method before claiming something people! =P
SSH servers are one of the MOST secure "servers" that you can run to remotely access your home computer. I have used an SSH server on my home computer using a non-default port, DSA keys with pass-phrases (which is really paranoid), A firewall only allowing ATT and other IP addresses.
Running any server on your computer is "less secure", so unless your a CEO of a billion dollar corporation, keep it on a default port with a password. Computer security relies on the user not the computer, dont hand your passwords out, and set up your SSH server on a non-default port and you will be fine...
For the SUPER PARANOID with Router's and Firewalls:
Setup SSH on port above 50000 (thwarts basic port scanners), forward ONLY that port to ONLY a single internal IP
ONLY Allow ONE account (admin or not) to have access to this server (this can be done through mac/systempreferences/sharing)
Create DSA Private Keys with Pass-phrases. Passworded DSA keys have never been cracked, RSA have been, but ONLY with NO-PASSWORDED keys.
Allow ONLY DSA keys (not passwords) to your server by editing the sshd_config file within private/etc
PasswordAuthentication no
#PermitEmptyPasswords no
Setup VNC server on any port above 50000, allowing ONLY access from localhost 127.0.0.1 (require loopback SSH)
ONLY Allow Certain ranges of IP's to access your server (any incoming firewall like flyingbuttress)
AT&T IP Ranges:
32.0.0.0 - 32.255.255.255
166.128.0.0 - 166.128.255.255
166.135.0.0 - 166.135.255.255
166.191.0.0 - 166.191.255.255
166.134.0.0 - 166.134.255.255
166.205.0.0 - 166.205.255.255
166.190.0.0 - 166.190.255.255
If you are not behind a router AND do not have a firewall, I would not recommend running ANY servers on your home computer. But if you are going to run one, this is by far one of the most secure servers of the world...
We are only as "safe" or "secure" as the Admin makes us, doesnt matter what OS your running, you NEED a firewall, and you NEED to change your passwords every once in a while...
THIS POST IS NOT DEDICATED TO DEBATING THE SECURITY OF SERVERS, IT IS HERE TO DESCUS HOW TO USE SSH into the iPHONE NO MATTER WHERE IT GOES!!
But... if you ask me, its the safest thing in the world =P
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
************************************************** ***************************************
************************************************** **********************************
************************************************** ******************************************
************************************************** **********************************
UPDATE: it seems if im connected to 3G then i swap to WiFi, the existing tunnel remains, but I am unable to connect. ONCE I SWITCH BACK, WITHOUT RE-EXECUTING THE COMMAND, the tunnel is still connected and allows remote access. So I tried the other way, WiFi first, execute, then switched to 3G and then activated Wifi again, Tunnel remained!! interesting!! but if the source changes and doesnt return to the IP of the original "command giver's" IP address, the command will need to be executed again:
Seems this is something that an hourly process can fix... the process could run every hour, or somehow know when the internet source changes, whether it be to wifi, 3g or edge... Before the tunnel is re-created, the old "tunnel" would have to be closed via terminal/command, assuming you CANT use the same port to forward to (1201 in this case) while the localhost still sees it as connected. An hourly process would not be battery consuming and would allow for higher chances of getting phone back. NOTE: This will have to use a NoPassword DSA/RSA key, iphone supports all bits. DSA is known to be safer and has "never" been "cracked" =P
For those setting up an SSH server on Windows Operating Systems:
When you install Cygwin, make sure to follow their instructions, you must install it with its own directory, and make sure you have installed the correct SSH packets required to run an ssh server within cygwin... here is a good link for step-by-step Cygwin installation:
How to install OpenSSH sshd server and sftp server on a Windows 2000 or Windows XP or Windows Vista
OR (older version)
How To Set Up VNC Over SSH On Windows XP @ErikJHeels
WHEN you have problems or differences WITH THE ABOVE INSTALLATION RULES, read these posts:
Nabble - Cygwin list - Wrong Permission on the /var directory
Dave.Net: Installing a Loopback Adaptor in Windows Vista
Solution to problem: VNC connection failed: Local loop-back connections are disabled.
If you have completed that, and you are having troubles, contact me via email michael_withe21@hotmail.com