Wednesday, April 08, 2009

How to VNC from an Android phone to a Linux Computer Securely with an encrypted ssh tunnel.

I know I have not posted anything in forever, but this is just so nerdy I had to post it. I got my full Ubuntu Linux desktop on my T-Mobile G1, and I did it very securely. Here is how you can do it too (provided of course you have an Android powered handset, Linux at home and a desire to show off to nerds everywhere).

To create a secure SSH tunnel to your Linux computer from an android phone;

This guide assumes a few things; that you have an ssh server and VNC server running on your home system, and that you have your home router setup to forward ssh traffic to your home computer. Every router is slightly different so I cannot write a guide for them all, but it should be quite easy to figure out with some basic Google searching. I recommend dyndns to get your routers external facing IP updated through DNS to you can connect with less of a headache when your ISP changes your IP.

1) Download ConnectBot to your phone from the android marketplace, put in your computers IP or hostname information (and password of course). You may want to test this first step to make sure you can ssh in before you set up the port forward.

2) In ConnectBot click menu key on the phone.

3) Click Port Forwards on the screen.

4) Click menu on the phone.

5) Click Add port forward on the screen.

6) Enter the following settings.

Nickname: VNC

Type: Local

Source Port: 5901

Destination: 192.168.X.X:5900 (the Xs of course representing your local IP address on your home system, not the IP address of your Internet facing router. You can find your you IP with the ifconfig command)

7) Download androidVNC to your phone from the android marketplace.

8) Open androidVNC and enter the following settings.

Nickname: (leave this field blank)

Password: (The password you set up on your remote computer for VNC, check the Keep box)

Address: 127.0.0.1

Port: 5901

9) Click connect and you should be connected!

54 comments:

  1. worked like a charm! thx for the recipe. Droid meet X11. X11 meet Droid.

    Too bad using vim or wmii WM is tough on the droid ;(

    ReplyDelete
  2. Anonymous8:45 PM

    Now how do I route *everything* through a tunnel for browsing on public access points?

    ReplyDelete
  3. Anonymous1:29 PM

    You sir are a God, now I have an encrypted Ubuntu Desktop on my Android. This is promethean. Thanks so much.

    ReplyDelete
  4. Darn! I’m using an iMac and trying to connect with my rooted HTC Hero using Android-VNC and ConnectBot. I followed your excellent instructions to the letter, with one exception: for “Destination” I entered 10.0.1.144:5900 instead of 192.168.X.X:5900 (I think that’s correct, since I’m using Mac OS X). But I can’t connect!

    ReplyDelete
  5. Anonymous8:39 PM

    Yo are da man, I'ev been pissing around trying to get this to work for a week now. Part I was missing was the ConnectBot port forwarding ... Cheers.

    ReplyDelete
  6. Anonymous8:35 PM

    Is there any reason why the destination
    has to be on the local network? Couldn't
    it be any accessible ip address?

    ReplyDelete
  7. Congrats on the new member of your family, lets raise him to be just like us Linux nerds :) Thanks for the post, it was very helpful.

    ReplyDelete
  8. For the user asking why it had to be the loopback address, a quick explanation of what this is accomplishing.

    First, by setting up port forwarding you are allowing your Droid to make a secure encrypted connection to the computer at home.

    Then by pointing VNC to the loopback address (127.0.0.1) you are telling the VNC viewer to try to connect from the droid back to itself. ConnectBot takes that connection attempt and sends it through the encrypted connection you already made.

    You can take these instructions a step further and config your computer to listen for SSH connections on port 443 in addition to the standard 22. This allows you to tunnel from behind many restricted networks (like the over-locked down one at the college campus).

    ReplyDelete
  9. Anonymous7:39 PM

    This tried for me the first time but not connectbot keeps saying the host is disconnected. I'm thinking maybe I started the ssh daemon wrong on my computer this time. I'm using sudo /etc/init.d/ssh any ideas what i'm doing wrong?

    ReplyDelete
  10. Anonymous6:45 PM

    Hi, thanks for this guide. However, I have a problem with connectbot.
    The 'port forward' option seems to be greyed out with 'local' type. Am I missing something here?

    ReplyDelete
  11. Anonymous10:40 PM

    AndroidVNC doesnt seem to work when connecting to Mac OSX internal VNC server. This process does work with other VNC viewers though (tested with pocketcloud)

    ReplyDelete
  12. Anonymous9:18 PM

    Thank you so very much! It worked like a charm.

    ReplyDelete
  13. Anonymous9:57 PM

    AndroidVNC to Mac OSX seems to be picky about the default color setting of 64. Crank it up and it works. Personally, Mocha VNC lite works so much faster for me than Android VNC

    ReplyDelete
  14. I absolutely appreciate your way of presenting this column with a excellent suggestion.I want some more about this article. So you can add some interesting information and it will easily to reach the branding.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Rather than following the instruction:
    Destination: 192.168.X.X:5900 (the Xs of course representing your local IP address on your home system, not the IP address of your Internet facing router...."
    Use 127.0.0.1:5900 This is particularly useful if your ip address changes due to a DHCP login,

    ReplyDelete
  18. Anonymous8:03 AM

    Thanks - very useful!

    ReplyDelete
  19. Anonymous4:23 AM

    when I try to connect to home with androidVNC I get: ERROR! VNC connection failed! null

    ReplyDelete
  20. Anonymous9:20 AM

    Thank you so much for taking the time and effort to share this.This was driving me nuts.

    I'm on OS X 10.6.8 and this blog along with Darwinlcesurfer's comment was the final piece of the puzzle for me.

    I had to use 127.0.0.1 for BOTH the AndroidVNC setup and ConnectBot's port forward.

    Another tip for OS X users get Vine Server. Its a free, open source [but is now maintained by a commercial company] VNC app that allows SSH connections. AFAIK, OS X's native VNC [a.k.a Screen Sharing] doesn't allow SSH connections.
    Vine Server also allows lower color depth than OS X's native VNC which only allows 24bit color.


    Also, a couple of tips for configuring Vine Server:
    Trying to log into my Mac, my password kept getting refused. It turned out that Shift [and Caps] wasn't working. In Vine Server go to:
    Preferences/Device set the Keyboard Layout to Unicode Hex Input.

    I was also getting intermittent RFB errors. So I went to
    Permissions/Advanced and set RFB Protocol to 3.7 and so far I haven't had the RFV error.

    Thanks again for this blog. God bless :-)

    ReplyDelete
  21. Anonymous3:31 PM

    YESSSSS!

    ReplyDelete
  22. Anonymous4:52 AM

    Thanks for this. However, DarwinIcesurfer's is key to making it work correctly through a NAT router.

    ReplyDelete
  23. developej2:56 PM

    had to type 127.0.0.1:5901 in connectbot port forward too. 192.168.*.*** wouldn't work.

    thanks for the guide though

    ReplyDelete
  24. Pretty nice post. I just stumbled upon your blog and wished to say that I have really enjoyed your blog posts.In any case I’ll be subscribing to your feed and I hope you write again soon!…clipping path

    ReplyDelete
  25. After a few hours' trying to resolve an undocumented bug/'feature', it seems worth putting in a comment in case someone else has similar difficulty:

    avoid use of the -localhost flag in the linux vncserver command, as for some reason it blocks even the ssh tunnel/forwarded port from accessing the vnc server

    as long as the firewall for the machine that's running the server, is itself blocking vnc / vnc ports, then the ssh tunnel should be the only effective way in

    ReplyDelete
  26. Really this site is very good site and the post include a lot of resource.thanks for share with us.good bye.

    ReplyDelete
  27. Thanks for the post and sharing the blog. Valuable and excellent post, as share good stuff with good ideas and concepts.
    lots of great information and inspiration. I just would like to say thanks for your great efforts.
    I appreciate your excellent post.

    ReplyDelete
  28. Amazing post you have published with us . So much thanks for shared .

    ReplyDelete
  29. wonderful article! We are linking to this particularly great content on our site. Keep up the great writing.

    ReplyDelete
  30. Anonymous9:51 AM

    I tried with VNC but it is not working with Coc Lights server why? I love Clash of clans game but it is not enabled on their servers? why?

    ReplyDelete
  31. Helpful tips. As i photo editing that was very helpful for me.

    ReplyDelete
  32. Hey Very Nice Blog!!! Thanks For Sharing!!!!

    ReplyDelete
  33. I was reading some of your posts on this internet site and I believe this web site is really instructive! Keep on putting up.

    ReplyDelete
  34. Anonymous2:01 AM

    Wonderful post.Thanks for share.
    http://clippingpathindie.com/furniture.html

    ReplyDelete
  35. A very nice website. Blogs are very helpful.Thanks for sharing this website.
    Clipping Path | Color Correction | Photo Retouching | Product Photo Editing

    ReplyDelete
  36. Thank you so much for sharing these nice articles clipping path service

    ReplyDelete
  37. http://www.designercountry.com/Photo-Background-Change

    ReplyDelete
  38. Being a member of the Association of Indian Universities (AIU), the programs are recognized by WES. Students may verify the same from the WES platform for Canadian Immigration. NMIMS Distance Education program serves its students with highly innovative and revolutionary technology and offers every digital solution to enable faster and most tactful learning process to its students.
    nmims distance fee payment
    nmims distance university
    nmims college distance education
    nmims distance result
    nmims online distance learning

    DY Patil Distance Learning program is aimed towards a slick and rapid improvement in the process of education while maintaining the contemporary standards of the educational industry in the genre of Hospitality and Management. Being renowned as a sophisticated university, DY Patil has several tie-ups with some of the best international industries.
    dr dy patil vidyapeeth pune distance mba
    ajeenkya dy patil university distance education
    dy patil distance education mumbai
    dy patil university distance education
    dy patil institute of distance learning admission 2020

    The School of Distance Education and Learning has executed the same schooling pattern from its mother university and continues to spread its remarkable influence across Rajasthan. The students and alumni members are provided with innovative self-learning study materials. JNU Distance Learning also offers consistent and well-organized counselling programs to its JNU Distance Learning students by renowned and experienced counsellors right at their doorsteps.
    jaipur national university distance education bca question paper

    jaipur national university distance education contact details

    jaipur national university distance education login

    jaipur national university distance education ba

    \jaipur national university distance education results june 2020

    ReplyDelete
  39. Yes, it works. Thanks for sharing. clipping path

    ReplyDelete


  40. Some pain pill cannot cure your pain. Yet it can help you to get effective and temporary relief from body pain. This painkiller can work best when it is taken with rest and proper treatment.
    Soma 500mg
    tablet Soma 500mg
    500mg Soma

    ReplyDelete

  41. This is very informative post. Thanks for sharing.






    Photo Retouching Services

    ReplyDelete
  42. Thank you so much for sharing your informative article. I appreciate it.
    Really this site is a very good site and the post includes a lot of resources.
    discoverycentre

    ReplyDelete
  43. Anonymous3:02 AM

    Hello, I want to have one of these piercing models, but I am unsure. Can you look at it?

    Double Helix Piercing

    Snug Piercing

    Snake Eyes Piercing

    Tragus Piercing

    Corset Piercing

    Tragus Piercing & Piercing

    ReplyDelete
  44. pretty cool tips. I really appreciate your post. I definitely visit this blog again
    Background Removal Service
    Clipping path Service

    ReplyDelete
  45. Really a helpful post forever. I have seen and read it carefully . I really appreciate your post.
    Clipping Path | Car Photo Editing | Neck joint Services

    ReplyDelete
  46. Thanks for your post on How to VNC from an Android phone to a Linux Computer Securely with an encrypted ssh tunnel! Great post for tech lovers.
    Fixwill

    ReplyDelete
  47. OMG. you nailed it.
    I’m professional Graphic Designer at Clipping Path Service . We provide high-quality clipping path service, background removal service, Image Masking Service , neck joint service, ecommerce image editing service, car image editing, photo retouching service at reasonable price. Please visit our website, check out our portfolio and give your feedback.

    Thank You.

    ReplyDelete
  48. image masking service out or blocking out an area of a photo, video, or other media is an excellent way to hide any unwanted content. This professional service can be used for many different reasons, such as to remove naughty parts from a photo for social media, not showing the house number on the curb in front of your house, or simply wanting to delete your ex-girlfriend from your Facebook profile picture.

    ReplyDelete
  49. Nice Post!! Very Helpful. We Provide

    Clipping Path.

    We are an offshore Clipping Path service providing company, including Photoshop Masking, Drop Shadow, Retouching, Resizing, and Image Manipulation.

    ReplyDelete
  50. you are really good at what you are doing. keep it up.

    ReplyDelete