Source : https://sites.google.com/site/al271828183x/techblog/dropbearhow-tosetupsshserveronembeddedlinuxtargets
'm using SSH Server on Embedded Linux Targets for my development purposes. To be more specific I'm using Eclipse with Remote System Explorer extension, which requires SSH connection to be established between Development Station and Embedded Linux Target.
Below is a simple step-by-step guide to setup SSH Server (Dropbear) on your Embedded Linux Target.
- You need to prepare "sftp-server" for Embedded Linux Target, so you need to cross-compile OpenSSH
- Download and unzip OpenSSH source code (for example: openssh-6.0p1.tar.gz)
- In OpenSSH directory create "build" sub-directory
- In the "build" directory create following "build.sh" script (you need to modify path to your cross tools, gcc and strip):
- Run "build.sh" (don't forget "chmod a+x build.sh")
- "sftp-server" executable will be created, copy it to your Embedded Linux Target and place it to the "/usr/libexec" directory
#!/bin/bash
export PATH=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-cirrus-linux-gnu/bin:$PATH
../configure --prefix=$($PWD) CC=arm-linux-gcc --host=arm
make sftp-server
arm-linux-strip -v sftp-server
- Now you need to create SSH key pair on your Development Station (I'm running on Fedora distribution)
- In directory "~/.ssh" execute "ssh-keygen"
- Copy "id_rsa.pub" file to Embedded Linux Target and place it to the "~/.ssh" directory
- On Embedded Linux Target from directory "~/.ssh" execute following command:
cat id_rsa.pub >> authorized_keys
- Dropbear, you need to cross-compile Dropbear for your Embedded Linux Target
- Download and unzip Dropbear source code (for example: dropbear-2012.55.tar.gz)
- In Dropbear directory create "build" sub-directory
- In the "build" directory create following "build.sh" script (you need to modify path to your cross tools, gcc and strip):
#!/bin/bashexport PATH=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-cirrus-linux-gnu/bin:$PATH../configure --prefix=$($PWD) CC=arm-linux-gcc --host=armmakearm-linux-strip -v dropbeararm-linux-strip -v dropbearkey
- "dropbear" and "dropbearkey" executables will be created, copy them to Embedded Linux Target and place them in "/bin" directory
- Now you need to create SSH host keys for Dropbear
- On Embedded Linux Target create directory "/etc/dropbear/"
- In the "/etc/dropbear/" directory execute following lines:
dropbearkey -t dss -f dropbear_dss_host_keydropbearkey -t rsa -f dropbear_rsa_host_key
- Running SSH Server
- On Embedded Linux Target execute following line:
dropbear -s -g
can u tell me the steps to compile ssh on to x86 embedded board
ReplyDelete