Active Topics

 


Reply
Thread Tools
Posts: 44 | Thanked: 28 times | Joined on Mar 2010
#31
i just got ddclient to work so it can update my dynamic IP adress (http://sourceforge.net/apps/trac/ddclient)

only one problem: perl on de n900 seems to lack the sys/hostname.pm module.
so i copied this from my ubuntu box to the n900 , made the configfile in /etc/ddclient, made a /var/cache/ddclient dir and the ddclient is running and updating my ip adress with zonedit
very happy with this..

planning to run it every time the gprs0 goes ip .. if its on wifi i guess remote ssh'ing is useless when stolen, they have to forward all ssh traffic for this to work..
 
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#32
I saw this thread but immediately saw that it is not going to work unless you use the phone to intiate a reverse ssh tunnel to a remote host, due to most internet connections being NAT.

My solution which I have finally got working is this:

1. setup an ssh server on a remote host that is on the internet. I run it on port 443 as it's unlikely that it'll get blocked

2. setup key file based login on the server and copy the public key to the phone. This is the fiddly step.

3. create a file in /etc/network/if-up.d/ that contains something like:
ssh -o ExitOnForwardFailure=yes -vvnTNx -p 443 -R 22222:localhost:22 user@remotehost

This way, every time it connects to the internet, it will try to create a reverse tunnel to your remote host. Then if I need to connect to my phone, I do the following command on my remote host:

ssh -p 22222 localhost

hope this helps.

Last edited by Sonny_Jim; 2010-03-28 at 02:44.
 
Posts: 477 | Thanked: 118 times | Joined on Dec 2005 @ Munich, Germany
#33
Originally Posted by Sonny_Jim View Post
I saw this thread but immediately saw that it is not going to work unless you use the phone to intiate a reverse ssh tunnel to a remote host, due to most internet connections being NAT.
Why not use the built-in sip client? Not only it always store the N900's i.p. in the registar (and you can normally get the i.p. of your N900 from the web interface of your int. phone company), but it will also open a port in the NAT router so that it can be called.

If you use sipphone (which is the company behind gizmo), you can logon using your user i.d. and get the i.p. and the open port of your N900. You can also use any port, not just 5060.
 
Posts: 82 | Thanked: 44 times | Joined on Feb 2010
#34
Originally Posted by Sonny_Jim View Post
3. create a file in /etc/network/if-up.d/ that contains something like:
ssh -o ExitOnForwardFailure=yes -vvnTNx -p 443 -R 22222:localhost:22 user@remotehost

This way, every time it connects to the internet, it will try to create a reverse tunnel to your remote host.
From my basic understanding of how Maemo works, this will happen whenever the internet connection is brought up. I am currently roaming, so I don't want to accrue data charges while I am not connecting to wifi.
My question is this - if I only allow the device to connect to the internet via wifi, is there any way that this tunnel could use one of the other interfaces to send/receive data? (they go up, even if they don't get an internet connection, right?), or is it constrained by my internet connection choices?

Ben
 
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#35
but it will also open a port in the NAT router so that it can be called.
Maybe it'll be able to get the port forwarded, but then maybe it's behind a very restrictive firewall. I feel that using a reverse tunnel on port 443 to a remote host is the bulletproof method:

It can be hidden at a very low level (/etc/inittab) and doesn't rely on any kind of user input, only that the thief has the phone switched on whilst near any open wifi.

You can make the phone connect to a different server by updating the dns of the remote host you programmed it to connect to. So, say you needed to bring down the remote server, you could put another in it's place without having to reprogram the phone.

Pretty much every firewall in the land allows port 443 and traditionally it's not monitored that heavily, as most traffic across it is expected to be encrypted/

Originally Posted by benh_n900 View Post
My question is this - if I only allow the device to connect to the internet via wifi, is there any way that this tunnel could use one of the other interfaces to send/receive data? (they go up, even if they don't get an internet connection, right?),
There is a global var that tells you whether you are connected via wlan or gprs, so you can use that to stop it from sending data when it's using GPRS:

if [ "$ICD_CONNECTION_TYPE" != GPRS ]; then

It could quite easily use GPRS and shouldn't use much bandwidth at all unless you use the tunnel. I was thinking of having some rules as to when it should try and use GPRS to connect, something like no connection for a week via WLAN, try using the GPRS. It would be nice to work out a script that collected as much geographical/call related information, encrypt it then use the ssh tunnel to drop it off at the remote server.
 

The Following User Says Thank You to Sonny_Jim For This Useful Post:
Posts: 82 | Thanked: 44 times | Joined on Feb 2010
#36
Originally Posted by Sonny_Jim View Post
There is a global var that tells you whether you are connected via wlan or gprs, so you can use that to stop it from sending data when it's using GPRS:

if [ "$ICD_CONNECTION_TYPE" != GPRS ]; then

It could quite easily use GPRS and shouldn't use much bandwidth at all unless you use the tunnel.
I looked at that and played with it, but it always seems to have no value in it for me, but then I am only connecting via wifi right now as I am roaming abroad, hence don't want to use non-wifi internet because of the data charges.

Thanks though!

Ben
 
Posts: 1,341 | Thanked: 708 times | Joined on Feb 2010
#37
Originally Posted by synthaxx View Post
Code:
...
def on_changed(device, data):
    if not device:
        return
    if device.fix:
        if (device.fix[1] & location.GPS_DEVICE_LATLONG_SET) and (device.fix[1] & location.GPS_DEVICE_TIME_SET) and not (device.status & location.GPS_DEVICE_STATUS_NO_FIX):
            print "lat = %f, long = %f" % device.fix[4:6]
            data.stop()
...

loop.run()
Now save and run it with

Code:
python2.5 gps.py
If everything goes well you'll get a LAT LONG you can plug into google maps.
If it's out of GPS range, you'll have to kill it with CTRL+C.
How to change that Python script to get altitude also?
(Sowwy for being lazy and not look it up from specs myself.)

Last edited by zimon; 2010-04-02 at 17:48.
 
Posts: 22 | Thanked: 19 times | Joined on Nov 2009
#38
Originally Posted by zimon View Post
How to change that Python script to get altitude also?
(Sowwy for being lazy and not look it up from specs myself.)
Code:
$ diff oldgps.py gps.py
14c14
<             print "lat = %f, long = %f" % device.fix[4:6]
---
>             print "lat = %f, long = %f, alt = %f" % (device.fix[4:6] + (device.fix[7],))
Hopefully that will help
 
Posts: 2 | Thanked: 0 times | Joined on Apr 2010
#39
hi , i need some help from you guys , my mobile(n900) is stolen . i m living in Qatar . is there any way that i can track the location of my mobile . plz help
 
speculatrix's Avatar
Posts: 880 | Thanked: 264 times | Joined on Feb 2007 @ Cambridge, UK
#40
Originally Posted by Sonny_Jim View Post
1. setup an ssh server on a remote host that is on the internet. I run it on port 443 as it's unlikely that it'll get blocked
it's easier to set up openvpn!
__________________
Fujitsu U820, HTC Vision/G2/DesireZ, Nokia N800 770 E71, Zaurus 6000, Palm T3, Zaurus C3100 - stolen
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:55.