Shopping Cart

Posts

Installing SSH server on pcDuino

pcDuino board out of the box

pcDuino board out of the box

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:

adduser felis

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

ifconfig

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

apt-get update

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

joe /etc/ssh/sshd_config

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!

Oleg.

No related posts.

8 comments to Installing SSH server on pcDuino

  • Thomas

    Hi,

    I received my pcduino today but apt-get update returns a few errors that it can’t find some sources. And so it then fails to install the ssh server because it can’t find some deb files.

    I am using the Ubuntu that comes with the original pcduino, is there a patch for the apt sources?

    Thanks,
    Thomas.

    • Hi Thomas,

      I don’t remember any issues with apt. Is your pcduino connected to the Internet? Can you ping 4.2.2.2?

      • Thomas

        Hi Oleg, thanks for your quick reply. There indeed has been something wrong with the internet connection accessing some of the sources although generally iinternet worked.
        Anyway, after confirming the internet fully works the apt-get update finished successfully and installing ssh etc works now.
        Thanks a lot!

  • Thomas

    Btw, Oleg, I managed to so this over Wifi. You comment above that it won’t work for you. Did you get it working? For me it worked exactly as described in the tutorial on pcduino.com for wireless connections. Let me know if I can help you.
    Thomas.

  • Actually, the simplest way to restart the SSH daemon is “sudo /etc/init.d/sshd restart”.

  • Joseph

    I did follow your description and successfully get ssh working. Many thanks. However, I did encounter some warnings and errors that were ignored both at running apt-get update and apt-get install ssh.

    The file /etc/ssh/sshd_config looked completely different from the one shown above. No need to give permission to any special user. I was able to ssh form my iPad with no problem.

  • Joseph

    I have a question. I noticed that my pcduino is running linaro 12.07 and the latest version is 13.04. Is there a way to upgrade the present version to the latest one?

Leave a Reply

  

  

  



You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">