Skip to content

Linux Daily

Daily usage of linux, raw style

So it seems I finally got my filthy hands on a Raspberry Pi. So far so good, although the software stack is a bit lacking still. I’m sure it will catch up. Anyway, I immediately loaded the debian distro to an sd card, which, for the record, consists in doing

dd bs=1m if=~/Downloads/debian6-19-04-2012/debian6-19-04-2012.img of=/dev/rdisk1

and I was good to go.  The next essential step was to setup a decent remote ssh session. This is pretty trivial stuff, the only reason I’m posting this is I found a very simple way to give the Raspberry Pi access to the internet, while accessing it through ssh. Sounds interesting? Let’s bring it!

1. Set up ssh on the PI

It’s a matter of starting it

sudo service ssh start

and adding it to the list of startup services

sudo insserv ssh

2. Configure main machine

In network manager, just configure a wired connection like so

and so

It goes without saying that at this point you should restart the Raspberry Pi or its networking system. Right? Right?? I mean JESUS CHRIST this is some pretty basic SHIT I mean WHATLKDASlkNSDf THIS IS WHAT HAPPENS WHEN YOU FUCK A STRANGER IN THE A- -

3. Grab Pi’s IP

At some point your main machine is going to attribute an IP to the Pi. You can monitor syslog like so

tail -f /var/log/syslog | grep dnsmasq

For the record, it should look something like this

May 19 18:57:05 ubuntu NetworkManager[891]: <info> Starting dnsmasq...
May 19 18:57:05 ubuntu dnsmasq[5763]: started, version 2.59 cachesize 150
May 19 18:57:05 ubuntu dnsmasq[5763]: compile time options: IPv6 GNU-getopt DBus i18n DHCP TFTP conntrack IDN
May 19 18:57:05 ubuntu dnsmasq-dhcp[5763]: DHCP, IP range 10.42.0.10 -- 10.42.0.100, lease time 1h
May 19 18:57:05 ubuntu dnsmasq[5763]: reading /etc/resolv.conf
May 19 18:57:05 ubuntu dnsmasq[5763]: using nameserver 127.0.0.1#53
May 19 18:57:05 ubuntu dnsmasq[5763]: cleared cache
May 19 18:57:52 ubuntu dnsmasq-dhcp[5763]: DHCPDISCOVER(eth0) 10.42.0.19 b8:27:eb:84:ea:79
May 19 18:57:52 ubuntu dnsmasq-dhcp[5763]: DHCPOFFER(eth0) 10.42.0.19 b8:27:eb:84:ea:79
May 19 18:57:52 ubuntu dnsmasq-dhcp[5763]: DHCPREQUEST(eth0) 10.42.0.19 b8:27:eb:84:ea:79
May 19 18:57:52 ubuntu dnsmasq-dhcp[5763]: DHCPACK(eth0) 10.42.0.19 b8:27:eb:84:ea:79

Usually the IP attributed to the Pi is always 10.42.0.19.

4. Connect

You can go old school

ssh pi@10.42.0.19

Or with X support for GUI applications

ssh -X pi@10.42.0.19

Remembering that the default username is pi with password raspberry.

All done!

Addedum

If you want to go for a static ip solution, you need to edit the proper config file

nano /etc/network/interfaces
so that is looks like
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback
# iface eth0 inet dhcp
auto eth0
iface eth0 inet static
 address 192.168.0.69
 netmask 255.255.255.0
 network 192.168.0.0
 broadcast 192.168.0.255
 gateway 192.168.0.1

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: