Adding ssh on embedded linux

armcompilingembeddedsoftware installation

I want to run SSH on Qtopia (on my FriendlyARM). My own distribution is Ubuntu, so I cannot copy and paste the ssh binary file into the device.

If I can copy and paste a binary file, where can I find it? If I must compile SSH, how is it possible in my ubuntu?

Best Answer

Your device has an ARM processor. Your PC has an x86 processor. ARM and x86 are different processor architectures with different instruction sets. An executable program compiled for x86 consists of x86 instructions that an ARM processor cannot execute, and vice versa.

You need an ARM binary. Furthermore, you need an ARM binary that's compatible with the other software you have on your device. Specifically, you need either a statically linked binary (a binary that does not depend on anything else) or a binary linked with the right system libraries.

Check which standard library you have. If you have a file called /lib/ld-uClibc.so, you have uClibc, a small library intended for embedded systems. If you have a file called /lib/ld-linux.so.2, you have GNU libc, the same library that you have on your Ubuntu PC (and any other non-embedded Linux).

You have two choices of SSH clients and servers: OpenSSH and Dropbear. Dropbear is smaller, but has fewer features, in particular no SFTP.

If the standard library is Glibc, you can grab a binary from Debian's ARM distribution. Get the armel client or server package. Extract the .deb file by running

dpkg-deb -x openssh-….deb .

Then copy the binary from ./usr/bin or ./usr/sbin to the device.

If the standard library is uClibc, you'll need to grab a binary from a distribution based on uClibc. Dropbear is included in many embedded distribution. Openmoko, which shares some ancestry with Qtopia, includes Dropbear in its default installation. If you're going to want to install several programs, BuildRoot makes it very easy to obtain a cross-compiler and build common programs: you pretty much only need to follow the guide.

Related Question