At the end of February I received an e-mail from Jingfeng Liu of Linksprite informing me that they are launching a new product called pcDuino and offering a free sample. Two days ago I got a package in the mail containing the board, a WiFi dongle and a bag of cables. In ten minutes, most of them spent looking for spare keyboard and mouse, the system was up and running.
pcDuino is a mini PC platform based on 1GHz ARM Cortex A8 processor. It has 1GB of RAM, 2GB of Flash, 2 USB Host ports, 1 USB OTG port, HDMI video, Ethernet and Micro-SD slot. It comes with Ubuntu pre-installed and its graphic desktop is surprisingly responsive for such a small machine.
After an uneventful start – all you need to do is connect a keyboard, mouse and HDMI monitor – I started looking into ways to control my pcDuino remotely. Ethernet worked out of the box so physical connectivity was not really an issue. However, I haven’t found any access control tools and even root account is set up with no terminal password (and in KDE, the root password is ‘ubuntu’ – I managed to guess it at first attempt without ever looking in the doc). No remote access tool were installed either, which was actually a good thing since I needed to secure the root account first.
Even though pcDuino comes with graphic desktop, I prefer working with command line. I launched the
LXTerminal application from the desktop and typed
sudo su. This command switches current user to root. Now it’s time to give it a password. The command for it is
passwd. It will prompt for a new password and then will ask to confirm. The root is now password protected.
Now I needed an account for myself. On Linux machines my nickname is ‘felis’ so I typed:
The command asks several questions, one of them being a password for the user. Once this is done, I need to add myself to administrator group – this will allow me to use
sudo from my account. The command is similar to the previous one and looks like this:
adduser felis admin
The next step is to find out the IP address of Ethernet interface. The pcDuino is connected to a router which acts as DHCP server assigning dynamic IP addresses to the hosts on the LAN. I typed
and saw the following output:
1 2 3 4 5 6
eth0 Link encap:Ethernet HWaddr ea:54:d8:39:2b:f7 inet addr:192.168.255.25 Bcast:192.168.255.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ... (truncated)
inet addr is my IP address. Typically, DHCP server tries to assign the same IP address to the host if it has enough addresses in the pool so I expect my Ethernet interface to have the same address after reboot. I now know the IP address to connect to and it’s time to add a service.
To install ssh, first I needed to update repositories by typing
After the update is finished (this could take a while), I installed ssh, like that:
apt-get install ssh
and also Joe text editor:
apt-get install joe
With just installed editor (hardcore UNIX types may prefer using
vi instead) I opened
sshd_config by typing
and adding what looks like line 12 in the following listing. It instructs ssh server to only allow user felis to login via ssh. Once the line is added, press
Ctrl-K and then
X – this will save the config.
1 2 3 4 5 6 7 8 9 10 11 12
ServerKeyBits 768 # Logging SyslogFacility AUTH LogLevel INFO # Authentication: LoginGraceTime 120 PermitRootLogin yes StrictModes yes AllowUsers felis
The simplest way to apply new config is to reboot the machine by typing
shutdown -r now
After the pcDuino has rebooted, I launched
putty on my desktop PC and opened a shh session to the IP address I discovered earlier. At the prompt, I entered my username, password, and was logged in. I opened another window, tried to login as root and was denied access, as expected. The ssh works just like I wanted.
The next step is to configure Wi-Fi adapter. Unlike Ethernet it won’t work out of the box – the device gets initialized and goes up but it refuses to associate with the access point. For now, the pcDuino sits atop of the router powered from router’s USB flash drive port. Once I figure out how to configure Wi-Fi, I’ll write another post about it – stay tuned!