Raspberry Pi

My Raspberry Pi arrived on the 25th May 2012 🙂

Setting up static networking

Firstly, edit the network interfaces file
nano /etc/network/interfaces

Comment out (#) the dhcp line and use the following as a template for your static IP. In this example, I assigned my RasPi the IP 192.168.0.230.
iface eth0 inet static
address 192.168.0.230
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

Once done, save (Ctrl+O), exit (Ctrl+X) and restart the network interface
ifdown eth0 && ifup eth0

Setting up SSH

Start by regenerating shh keys in root:

rm /etc/ssh/ssh_host_*key

and then

dpkg-reconfigure openssh-server

Start the service for the session:

service ssh start

Check its working:

service ssh status

You should then be able to connect to your RasPi using SSH (via PuTTY on Windows)

Setting up VNC for remote access

Login to your RasPi (direct or via SSH if you followed the above instructions). Install the “tight vnc server”
sudo apt-get install tightvncserver
Then start the server with
tightvncserver

You will then be able to connect using a VNC viewer with the RasPi’s IP and port 1 (e.g. 192.168.0.230:1).

Using the root user

You may or may not need the root user, but to do so, you will need to set the root password (it may be out there somewhere, but I couldn’t find it). To set the pass, run
sudo passwd root
then enter your new password twice when prompted

Using GPIO as a non-root user

We obviously don’t want to run everything as root, so we want some safe controlled access. This seems to be a good solution, although I can’t seem to get git working properly yet: http://quick2wire.com/2012/05/safe-controlled-access-to-gpio-on-the-raspberry-pi/