What is a SheevaPlug? It is a network appliance that is fully enclosed in an AC power plug or AC adapter. It has a gigabit Ethernet port, SD memory slot, usb port, and mini-usbport. You can plug it right into the wall just like an ac adapter. All for $99.
It comes with 512 Meg ram and 512 Meg of flash based disk space. It runs a ARM processor and comes with Ubuntu Linux installed.
More info about the SheevaPlug can be found here.
I used this little plug computer to setup a backup mail server. You could use it for just about anything you like since it runs a full Linux distribution. Here is the basic setup I used to get everything going.
Connect to the SheevaPlug from a linux box using the usb cable that came in the box. This connection will be your serial console (USBtoSerial). To get the usb serial thing going I had to insert a few modules on my Linux box. Everything worked fine after that. I have also read that you can just plug it in and it will get a DHCP address off the network if you have a DHCP server. Then you can just ssh in from there.
sudo modprobe usbserial sudo modprobe ftdi_sio vendor=0x9e88 product=0x9e8f
Install the simple call up (cu) program to connect to the emulated serial port ttyUSB1. Then connect.
sudo apt-get install cu cu -s 115200 -l /dev/ttyUSB1
Login as root with the default password.
Login: root Pass: nosoup4u
Change your root password
Add a new user.
Use visudo and insert the line below to give your new user full sudo privs.
# add user in visudo newuser ALL=(ALL) ALL
Then turn on the setuid bit on the sudo program so you can actually use sudo. Sudo will not let you sudo to root if you don't do this.
chmod u+s /usr/bin/sudo
Edit /etc/network/interfaces. Comment out DHCP line. Put in static ip info.
# iface eth0 inet dhcp auto eth0 iface eth0 inet static address 192.168.1.60 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1
Edit /etc/resolv.conf and put in your ISP's DNS servers
domain yourdomain.org search yourdomain.org nameserver 192.168.1.1
The Ubuntu 9.04 that comes with the plug computer puts it's apt-get cache dir on a temporary file system. It's missing a dir so apt-get will not work until you make the dir. This line is in the /etc/rc.local file but it does not seem to execute on boot for some reason.
mkdir -p /var/cache/apt/archives/partial/
Install the Postfix SMTP server. This is the main reason for this box. You will have to put in your Posfix configs here. If you need examples see the menu on this site in the Postfix section. You can also search this site for the word Postfix.
apt-get install postfix apt-get clean all # put in your config files /etc/init.d/postfix start
I use procmail as my MDA so I'll install it.
apt-get install procmail apt-get clean all
Install ddclient so we can update the dynamically changing ip of our server.
apt-get install ddclient apt-get clean all
Edit /etc/default/ddclient file. Change run_daemon to true and daemon interval to what you want.
Then copy over your /etc/ddclient.conf file. An example one is below. This example uses a custom domain in the example. The backup mail server.
daemon=1800 # check every 600 seconds syslog=yes # log update msgs to syslog mail=root # mail all msgs to root mail-failure=root # mail failed update msgs to root pid=/var/run/ddclient.pid # record PID in file. cache=/var/run/ddclient.cache # Cache file ssl=yes # use ssl-support. use=web login=dynloginname # default login password=xxxxxx # default password protocol=dyndns2 server=members.dyndns.org custom=yes, backupmail.yourdomain.org
Install OpenNTPd. For some reason OpenNTPd needs a date near the real date to work. So we will set one close to the real date. Then update the hardware clock.
date 012618002009 hwclock -w apt-get install openntpd
Edit the /etc/default/openntpd file and put in the -s option. This is so OpenNTPd will set the time on start.
Install pflogsumm because I like mail stats. Install mailx because the mail package is to big and mailx does what we need. This will make a symlink to mail.
apt-get install pflogsumm mailx
Run crontab -e and put this line in cron for pflogsum to run stats each night.
# crontab -e 15 0 * * * /usr/sbin/pflogsumm -d yesterday /var/log/mail.log 2>&1 |/usr/bin/mail -s "`uname -n` daily mail stats" root
The Linux build for the SheevaPlug does not have iptables by default. You could put an updated kernel in if you want it but let's keep this simple. We just want to filter hosts that connect to sshd. So we can do it with tcp wrappers. We will allow only hosts who's DNS PTR records (reverse look up) resolve to my.isp.org. Edit the /etc/hosts.allow file and put this in changing it for your ISP. Remember to allow your local hosts to connect ot sshd also.
sshd : .my.isp.org : allow sshd : 192.168.1. : allow sshd : localhost : allow sshd : ALL : deny
Last but not least. Remember to forward port 22 and 25 on your ISP's router to the internal static ip you gave your SheevaPlug.
Just reboot and test. I can say it works great for me. Cheap, silent, very low power, Linux. What more could you ask for?