Monthly Archives: January 2013

Building OpenWRT from Source

The router that I am building OpenWRT for is TL-WDR3500 TL-WDR3600. I will be building Attitude Adjustment, Backfire branch

BASE BUILD

(1) Set up build environment
$ sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk flex quilt git-core

    $ mkdir ~/OpenWRT
    $ cd OpenWRT
    $ svn co svn://svn.openwrt.org/openwrt/branches/attitude_adjustment
    $ cd attitude_adjustment
(2) Configuring the build
   $ make menuconfig
   Fill in target system and target profile
   Select Base System, check install is minimal and save
(3) Compiling
    $ make make -j
(4) Installing Image (assuming the above is essential)
    Fireware images should be located in /bin, the correct image for flashing over the original firmware end with factory.bin

Quick Guide: Remotely adding a new user on Ubuntu 12.04

In the following is a quick guide to creating a new user (we will be calling this user “username”) on a Amazon Cloud EC2 instance with Ubuntu 12.04 AMI

CREATING NEW USER

We will begin by adding the new user and setting the new users password

$ sudo adduser

This command will then take you though the setting up a password. You can check the users that you now have my opening the /etc/passwd file

Now we are going to make use of a unix command called “visudo”, this allow you to edit the sudoerrs file in a concurrent access safe way.  Before using visudo, we need to check that the default editor is the one that we would like and change it, if required:

$ sudo update-alternatives –config editor

Now you will be given a dialogue where you can select your favourite text editor.

$ visudo

Now add the following line to the file that has been opened:

ALL=(ALL) ALL

Now exit the machine and log back in as ubuntu.
You can now switch to this newly created user with
$ su
$ cd /home/

GENERATING KEYS FOR SSH TO NEW USER

We are now going to generate the public key for public/private key pair that will be used later to SSH directly into this new user

$ ssh-keygen -b 1024 -f mykey -t dsa

This line has generated two files, the public key mykey.pub and the private key mykey. To be able to ssh from a local machine to the new paws user on this remote machine, we need to place copy the contence of paws.pub into /home/username/.shh/authorized_keys and we need to have a copy of the private key (called mykey) on the local machine

$ mkdir .ssh
$ chmod 700 .ssh
$ cat mykey.pub > .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys

Now that we have the key we need to transfer this key on to our local machine and generate the private key

$ sudo chown :ubuntu .ssh
$ sudo cp mykey /home/ubuntu
$ sudo chown :ubuntu .ssh/authorized_keys
$ sudo chmod 777 /home/ubuntu/mykey

Logout and return to local machine
$ scp -i originalkey.pem ubuntu@:/home/ubuntu/mykey mykeyNow you can ssh into your remote machine as this new user:$ chmod 400 mykey$ ssh -i mykey @url-of-server

Comparing Wireless Community Networks

As work on the Public Access WiFi Service (PAWS) continues, people regularly point us in the direction of other wide area WiFi networks. Potential we can learn a lot from these projects, from both the social and technical sides. Here I am going to try to focus on the technical details and the payment models:

For each project, I hope to us the following framework to access it:

Project Location:
Coverage provided:
Project Organisers and Partners:
Funders:
Reason for funder to invest in project:
Time network was available ?
Cost to the user:
Service provided to users in terms of bandwidth, time browsering, websites available etc ?
Are the services provides allocated per user or per device ?
What form of user sign-up required ?
Can the user by-pass these restrictions ?
How is the WiFi network secured ?
Is the WiFi network open or encrypted ? If encrypted, how easily is the password available ?
Is the network vulnerable to rough access points ?
Is the network vulnerable to packet sniffing ?
Is the network/APs vulnerable to DoS attacks ?
Are the user informed of the importance of us a VPN or HTTPS

Quick Guide : Amazon Cloud EC2

The following is a quick guide to setting up an virtual server on Amazon Cloud EC2:

SETUP

1) Login to AWS Management Console using your Amazon account and navigate to EC2

2) In the top right hand corner, check that the location of the servers is the one that you would like to use, I will be using Ireland

3) In the “Getting Started” section of the EC2 dashboard, select Launch instance to create a new virtual server

4) I will be demonstrating the “Classic Wizard”

5) Select the Amazon Machine Image (AMI) that you would like to use, I will be using the Amazon Linux AMI 2012.09, 64bit edition

6) Enter the instance details, I am going to be creating 1 micro instance on EC2 so I’ve not changed any of the options on this page or the following Advanced Instance Options page or Storage Device Configuration page

7) Now you can create tags, using tags for your instances is really useful so I highly recommend it. I’ve set the key and value to “PAWS-router-management-server”

8) Creating a public/private key is vital for using SSH to access your virtual server. Give the private key a sensible name and download it

9) Creating a new security group is highly recommended, otherwise you can use make use the default group. I will be accessing the server using SSH so I’ve opened up port 22 to SHH

10) Review the opinions you have chosen and save

ACCESS

1) If you navigate to the “instances” page, you will now be able to see your newly created instance. Selecting your instance will give you access to more detailed information

2) To access your new instance, open the terminal and locate the private key you downloaded during set up

3) Change the permissions on the key using: $ chmod 400

4) Connect via SSH using: $ ssh -i

More details on the Amazon Linus AMI are available at  http://aws.amazon.com/amazon-linux-ami/ . Its useful to note that there is no root password, you can’t SSH in as root or use su but if you use sudo, no password is required and that the package manager used is yum