Friday, April 2, 2010

PuTTY for Symbian

My experiences with PuTTY on my Nokia E63 and my openSUSE 11.2 desktop computer!

Today I discovered a new amazing thing! I was able to connect to my desktop computer, over WiFi, from my mobile!

Here's how I did it! This also acts like a tutorial to anyone, who is new to the world of SSH!

Things you'll need

  1. A desktop computer (if you're running a Linux distro, then better!) (and if you're running openSUSE 11.2:KDE even better!) (that's what I have!)
  2. A Nokia (Symbian series 60) mobile phone (a list of compatible phones is here)
  3. A wireless modem
  4. Some basic knowledge on how to use Linux's KDE environment, nothing much!


Okay, so let's get started
You'll need to first install openSUSE 11.2 on your computer! There's an amazing newbie guide to openSUSE 11.2 at http://opensuse-guide.org/. Go and read it; you'll learn everything about openSUSE (including how to install and stuff!)

Be sure you keep your wireless modem turned on and connected to your computer. So that openSUSE can automatically configure everything for you!

So, now that you've successfully installed openSUSE, sit back, relax and enjoy the beautiful KDE 4.3 desktop! Here's my desktop:


I know, I know, you just can't get your eyes off your breathtaking KDE 4.3 desktop, but you'll have to now look at your mobile phone, because we're now gonna install PuTTY on your Symbian phone!
 

Simply visit http://s2putty.sourceforge.net/ and go to the Download section. Here, download the appropriate installation file for your phone. You now need to transfer the .SIS installation file to your phone:

  1. Connect your phone in Mass Storage mode
  2. Hey, wait a minute, do you seriously need step-by-step instructions for transferring files?? I mean, come on, you can do this bit on your own!

After installing PuTTY, you should see the PuTTY icon in your Installations folder.

Now, come back to your computer. We now need to verify whether the SSH daemon is up and running.

  1. Click the green SUSE lizard logo on your Plasma panel.
  2. Roll your mouse over Computer.
  3. Click on YaST (Administrator Settings.)
  4. If prompted for the root password, enter it and say OK.
  5. The YaST control panel shows up.
  6. Now, click on System in the left-side panel, and then click on System Services (Runlevel) under System on the right-side.
  7. In the System Services window, scroll down until you see sshd. That's the SSH daemon. Select it and click on the Enable button below and you should get a pop-up window saying the the return value was 0 (success.) That's all. Now dismiss that pop-up window and say OK to the System Services window.
Come back to the YaST control panel window.We need to add an exception to your computer's firewall so that it allows SSH connections. Here's how you do it:

WARNING: What you are about to do is open the SSH port (22) on your computer. Anybody can connect to your computer using SSH, if this port is not protected by your firewall.

I highly recommend that you remove your telephone line from your modem now, so that you are safely disconnected from the Internet.

If you do this, you should be safe (except for local hackers who are within your modem's WiFi range!)



  1. On the left-side panel, click on Security and Users, and then on the right-side, click on Firewall, under the Security and Users section.
  2. Under the Firewall Configuration window, in the left-side panel, click on Allowed Services.
  3. Under the Service to Allow drop-down combo box, select Secure Shell Server.
  4. Now click on the Add button at the right-side. Notice that Secure Shell Server gets added to the list below.
  5. Click on Next button at the bottom-right-side of the window.
  6. You will now see a summary of the settings that are going to change. Click Finish and your openSUSE will perform the firewall setting changes.
Congratulations, you can now connect to your computer via SSH.

Just one last thing, you'll need to know your desktop computer's IP address. So open Terminal, it should be under green lizard icon >> Favorites section.

In here, type the following command:

/sbin/ifconfig

Here's what I see...


Under eth0, on the second line, there's this inet addr:, isn't it? Note the IP address written next to it. That's your computer's IP address. You'll need to enter this address in PuTTY.


Let's get back to PuTTY on your Symbian mobile phone


Here are the step-by-step instructions to connect to your openSUSE computer from your mobile phone:

  1. Start PuTTY from the Installations folder.
  2. Select Default.
  3. PuTTY will now ask you to enter the hostname of the computer you wanna connect to.
  4. Remember the IP address that you had noted down earlier? Type in the same here.
  5. Now, it's gonna ask you about which Access Point to use. Be sure your modem access point is defined in your phone. If not, the select Search for WLAN, select your modem's wireless network name (SSN) and optionally, enter the WEP/WPA2 key. By doing this, you'll be defining a new Access Point.
  6. Now PuTTY will attempt to connect to your computer.
  7. Once it's connected, it'll prompt you the enter the Login Name. Enter your openSUSE login name (user name) here. I use root so that I get full access rights. This is not a recommended approach.
  8. It'll now prompt you to enter the password. So, enter the password for that user.
  9. Congratulations, you've successfully connected to your openSUSE computer via SSH!
You can now use all the regular shell commands! Your mobile phone acts like a dumb terminal. If you wanna send special keystrokes, like ESC etc., that click Send and a list of keystrokes will appear.

I haven't figured out a way to transfer files between my computer and my mobile phone yet. There's a Java application called MobyExplorer and it has FTP support. Once I find out more about it, I'll blog it here!

Thank you for reading my blog and happy SSH-ing!

Post a comment if you have any doubts. I'll be happy to help you out!

Here are some more screen-shots of me using PuTTY!

Here's a the popular ls command in action!




Here's where I create a file called hello.txt using the cat command and the shell's here document, <, operator. I later display the contents of hello.txt using cat.




And this is the best part! You can actually use the vi editor and do programming!



I'm typing the program using my QWERTY keypad! Notice that I use the Send option to send special characters, in this case, the Tab character.


I'm done typing my hello-world C program!



Time to save and quit!



As you can see, my C program, hello.c has been created!



Let me just compile that program using g++.



There you have it, g++ has conveniently create the executable file, a.out for me!



Let's execute it, shall we?



And here's the output of our program!


That's the combined power of Linux, SSH and Symbian, baby! Symbian rocks!

That's all from me this time! Stay tuned for more!

13 comments:

  1. Awesome stuff!

    Try playing a song or a movie. I think that should work, shouldnt it? :)

    Next mayb u can even try running the X-server and kde!

    ReplyDelete
  2. @Rohan: Thank you, bro! I used an application called, Screenshot, developed by Antony Pranata. You can find more information at http://www.antonypranata.com/screenshot!

    ReplyDelete
  3. @Ashish: Thanks! I don't think playing a song etc. is possible... or maybe it is... I'll try to figure it out, though!

    Running the Xserver and KDE is definitely on my to-do list!

    ReplyDelete
  4. good for the symbians out there!thank Rishab! but for we the windows mobile people-we already have many freewares for this :-)(and here is where you can find them fellow WM mates-freewarepocketpc.net,some recommendations:
    1.http://www.freewarepocketpc.net/ppc-download-wifi-remote-access.html
    2.http://www.freewarepocketpc.net/ppc-download-mobile-wi-fi-router.html
    3.http://www.mymobiler.com/
    )There are still many,explore.I can't give links to all as Rishab may kick me out of this Opensource forum for advertising WM ;-)

    ReplyDelete
  5. @Sisira: Oh cool! Have you tried connecting to your computer via SSH?

    Thank you for the links, Windows Mobile users will find this useful!

    No it's okay, I won't kick you out! We open-source guys do not detest Windows. We're the "live-and-let-live" folks!

    My brother, Rohan, wanted a J2ME-based SSH client (He doesn't want to install .exe files on his HTC Touch Viva. He said something about his phone slowing down due to too many applications!)

    Can you please suggest a J2ME-based SSH client for him?

    Thank you!

    Cheers,
    Rishabh

    ReplyDelete
  6. u have done a great job i shall try this with my mobile...

    ReplyDelete
  7. @Siva:
    Yeah, sure! Please try it out and share your experiences with us!

    ReplyDelete
  8. Well Rishab,I don't know the exact purpose you will be using that for but to login to a desktop -windows mobile has the same Remote Login option you have in Windows XP(though not used yet).May be you can use that.and for the reverse connection My Mobiler can be used.

    ReplyDelete
  9. And as far as the HTC Viva slowing down, the slow processor (201Mhz)is the most probable culprit.

    ReplyDelete
  10. @Sisira: Oh okay, HP! I'll look in the Remote Login thingy!

    Yeah, that processor is dabba! :D

    ReplyDelete
  11. Hi Rishab, thanks for the great post!

    Is it possible to transfer files to my nokia from my win 7 desktop using putty desktop client?

    ReplyDelete