debian

Home Server SMS - Just For Fun

Yesterday I was kind of bored when I noticed I still had an old Nokia 3110C laying around + a simyo (cheap belgian operator) sim card I didn't use anymore.

I decided it was playtime! Let's make my homeserver send me some sms's.

After a bit of research it was time to start testing. My homeserver runs ubuntu-server at the moment, but this tends to change quite often. As does the setup. It will change again soon because I will be getting a soekris :-).

Anyway, on with the fun!

A few easy steps to make your (home)server sms you:

1. Connect your phone

Take your old nokia phone (in my case the Nokia 3110C) and the included datacable. Connect it to your server choosing the pc suite mode on newer phones, or the "nokia mode" on somewhat older phones.

2. Install smstools

You can install smstools on ubuntu 8.10 (tested) with:

apt-get install smstools

Or you can download the source at http://smstools3.kekekasvi.com/ and compile the code yourself.

3. Configure smstools

After you did this it is time to configure smstools.
Open the file /etc/smsd.conf and add/change the following lines:

devices = GSM1

with this line you specify which device smstools needs to talk to.

loglevel = 7

to set the loglevel to debug, this gives you more information in the logfile: /var/log/smsd.log

[GSM1]
device = /dev/ttyACM0
incoming = no

The device parameter needs to point to the serial interface for your phone. Normally this is /dev/ttyACM0, but it could also be /dev/ttyUSB0 for example. If you can't seem to find the serial interface follow these next steps to make sure your cellphone is recognized:

lsusb

You should see some entry like:

Bus 001 Device 017: ID 0421:0428 Nokia Mobile Phones 

And:

lsmod

You should see the following modules loaded:

sbcore               112644  7 usbserial,cdc_acm,rt73,usbhid,ehci_hcd,ohci_hcd

The incoming parameter is set to no, this means we will not read incoming text messages on the phone and deliver them to /var/spool/sms/incoming. Sadly enough my too old Nokia 3110C does not support the AT commands for reading text messages over the data connection.

The only list I found of Nokia phones that should be able to read text messages through AT commands is at:

http://discussion.forum.nokia.com/forum/showthread.php?t=52900

4. Start smstools

If everything went right you can start the smstools with:

/etc/init.d/smstools start

or

/etc/init.d/sms3 start

To send an sms you can simply drop a file in /var/spool/sms/outgoing.

Your text file should look like:

To: 32495123456

Hi! This is a test.

If your cellphone supports the AT commands for reading incoming messages over data you can edit the smstools configuration
and put incoming=1 in there. Now, all incoming text messages will be available for you/your script or your program to read in:
/var/spool/sms/incoming

To test this I created a perl script which fetches an RSS feed, filters out interresting stuff, and drops a file with the description in /var/spool/sms/outgoing when the script hasn't seen this story before.

Now I get sms updates about that rss feed :-)

That's all folks!

Oh, 1 note: make sure you also connect the charger to your cellphone. I noticed that when the datacable is connected the battery seems to run flat rather fast...

 

 

Apt-get install wife

Apperantly it's kinda old but I didn't know this one:

apt-get install wife

One time passwords on linux

As I was reading my rss feeds I discovered one time password logins via ssh. I read it in a post on Philip's Blog. I found it interesting so decided to try this on a virtual machine as a test. Although it wasn't as simple as Philip's post, it was rather simple. But to help out you guys trying to configure and use it here are my findings: As this is a rather long post I'm going to use a break for this one time (sorry rssfeed readers! I forgot but I noticed my feed feeds entire blog posts, and not just the part before the break. Good!).

First, I installed opie-server, this is as simple as:

# apt-get install opie-server

Then, to make sure when you login through SSH, the pam_opie module is used, I had to edit /etc/pam.d/sshd as follows:

[...] # Standard Un*x authentication. #@include common-auth auth    sufficient      pam_opie.so auth    sufficient      pam_unix.so nullok_secure auth    require         pam_deny.so [...]

If you do it this way you will still be able to login with your normal password when te OTP(One Time Password) login fails. This may be handy when you have no possibility of calculating the appropriate response to the OTP challenge. If you do not like this behaviour and you want you or your users to be able to authenticate with OTP only you can comment out the pam_unix.so line:

[...] #auth    sufficient      pam_unix.so nullok_secure [...]

As after this it was still not working I looked into the /etc/ssh/sshd_config file and found that there was one option that needed to be enabled to make sure that the ssh server knows you will be using challenge response authentication. Edit /etc/ssh/sshd_config:

[...] ChallengeResponseAuthentication yes [...]

As a final step restart your ssh server:

/etc/init.d/ssh restart

As of here we can follow the simple step that Philip gave us in his blog post

:

$ opiepasswd -c Adding bert: Only use this method from the console; NEVER from remote. If you are using telnet, xterm, or a dial-in, type ^C now or exit with no password. Then run opiepasswd without the -c parameter. Using MD5 to compute responses. Enter new secret pass phrase: Again new secret pass phrase: ID bert OTP key is 499 mi7400 RIDE LUSH VIE YE BARD LOSE

When issuing opiepasswd -c you will be asked to enter a secret pass phrase, you will have to be able to remember this, but it should be very secret(not like your birthday or something like that). When we look at the following output:

ID bert OTP key is 499 mi7400 RIDE LUSH VIE YE BARD LOSE
  • 'bert' is your unix username, and your OTP ID
  • '499' is the sequence (this will count downwards every time a password has been used An already used password will be discarded and not usable anymore, hence OTP(One TIme Password) :-)
  • 'mi7400' is the challenge string
  • 'RIDE LUSH VIE YE BARD LOSE' is the password for this sequence (499) !! spaces included

Now, when ssh'ing to the system, and you have no private key file (because this will still work) you will be prompted the following:

$ ssh bert@minerva otp-md5 498 mi7400 ext, Response:

On a system where opie-client is installed you can calculate the appropriate response:

$ opiekey 498 mi7400 Using the MD5 algorithm to compute response. Reminder: Don't use opiekey from telnet or dial-in sessions. Sorry, but you don't seem to be on the console or a secure terminal. Warning: Continuing could disclose your secret pass phrase to an attacker! Enter secret pass phrase: WACK WAIT ALMA HERO WAR KIN

And use this password 'WACK WAIT ALMA HERO WAR KIN' to log in. Now offcourse the thing about this is that when you got your favorite machine with you (e.g. laptop) you do have your private keys. So there's no need for OTP. And when you need it (e.g. a public computer) you are not always (read: seldom) privileged to install an opie-client to calculate your response. Offcourse you can find online calculators but do you trust them with your passphrase? Luckely there's a nice solution for this problem: http://code.google.com/p/j2me-otp/ Thanks to "Marcin Gryszkalis" who posted this comment on Philip's blog post. This is a java application, so it should work on almost any modern cellphone. I tried this on my Nokia E61i and it works like a charm. (And offcourse, you do always have your cellphone with you!). A screenshot of the calculator in action: The only thing I could say about this application is that they chose to call the passphrase "Password" which might be a bit confusing. So, if you are a bit paranoid, or you just require a very secure authentication mechanism, this works like a charm, is not too difficult to setup and provides you with a handy mobile solution!

Enlightenment fun...

After 1 year of ubuntu + gnome desktops I switched back to my old 'love': enlightenment! Well, actually my first love was fluxbox. Pro's for me:

  • It's a window manager, not a bloated desktop environment
  • It's FULLY customisable
  • It's lightweight (resource-friendly)
  • It's FUN
  • ...

So, why enlightenment?

Well enlightenment (or e16, the old version :-)) has all fluxbox has to offer + nicer features. These are that one can use a desktop pager with LIVE UPDATING screenshots, this is quite nice compared to a pager that shows you these plain old square boxes. And also the iconbox (where your minimized applications live) supports icons that are actually screenshots of the window you minimized)

What does all this look like?

Some screenshots:

Debian + Enlightenment Screenshot 1

Debian + Enlightenment Screenshot 2

Debian + Enlightenment Screenshot 3

P.S. The bar at the top is conky with own_window set to true and some transparency.

OTS - Open Text Summarizer

Today I read about a tool that’s called OTS (Open Text Summarizer) on the debain package of the day website. It summarizes a text using word frequency to prepare a list of keywords and assign priority to sentences based on that frequency. Time to test it?

So, I tested it just for fun to see how well it summarizes. The first summary I had it do was one of the ISPConfig entry I wrote yesterday.

The output:

As we got our new serenity server we decided to use ISPConfig to enable us to easely create hosting plans/clients/sites so that we can offer these services in the not so far feature. Now ok, you can change the user prefix to [DOMAIN]_ by logging in as admin and changing it in the ISPConfig settings. If you would want a copy of the script, you can obtain it here: http://dev.paradize.be/ispconfig/ It.s written in Perl because I.m used to Perl :)

Not that great, this one but hey it’s an automated tool, can’t expect a little tool to be as smart as humans can we? No “I, ROBOT” situations for us in the future.

Syndicate content