Cross-Compiling for DroboFS: openSSH-5.6p1
Here is another post on the cross-compile series for DroboFS.
Introduction: Why openssh?
Just because! (sftp and sshfs)
Overall compiling complexity: Easy to medium.
Step 1: Background info
To be able to make use of this post, you need a VM configured as indicated in this post.
Step 2: Enter the cross-compiling environment
See step 2 of this post to see instructions on how to enter the chroot environment.
Step 3: Dependencies
Step 4: Get the source code
openSSH website: http://www.openssh.com/
Direct link: http://mirror.switch.ch/ftp/pub/OpenBSD/OpenSSH/portable/openssh-5.6p1.tar.gz
Make sure that you are in the folder /root/code, then type:
tar xzf openssh-5.6p1.tar.gz
Step 5: Configuration
Configuration for openssh is the same like other libraries:
./configure --host=arm-none-linux-gnueabi --prefix=/usr/arm
This should return no errors.
Step 6: Compiling
Within the folder /root/code/openssh-5.6p1
Again, there should be no errors. If any errors are reported, make sure you performed steps 3 and 4 correctly. If you still have errors, make sure that the VM is properly configured (e.g. like I did the first time around, when I got the wrong toolchain, or forgot to ‘export’ the proper compiler flags).
Step 7: Installing
Installing is simple:
We don’t want it to generate the keys, not just because the keys have to be generated on the drobo but also because it wont work So we use “make install-nokeys” instead of “make install”
The keys will be generated on the DroboFS later.
which will place the compiled library under /usr/arm.
Then we package the whole /usr/arm and copy it over to the DroboFS, as indicated on step 9 here.
Step 8: Generating Keys
Log in to your DroboFS through SSH (Dropbear is still running ;)).
Make sure that the Sym-Link /usr/arm is pointing to /mnt/DroboFS/Shares/DroboApps/arm.
ssh-keygen -t rsa1 -f /usr/arm/etc/ssh_host_key
ssh-keygen -t dsa -f /usr/arm/etc/ssh_host_dsa_key
ssh-keygen -t rsa -f /usr/arm/etc/ssh_host_rsa_key
Step 9: Configuring and Testing SSHD
Since Port 22 is still used by Dropbear we will change the default port in the configuration file of SSHD.
# Change default port 22 to 2222 Port 2222 # # Set the paths to the host keys # # HostKey for protocol version 1 HostKey /usr/arm/etc/ssh_host_key # HostKeys for protocol version 2 HostKey /usr/arm/etc/ssh_host_rsa_key HostKey /usr/arm/etc/ssh_host_dsa_key # Disable privilege separation, since the user "sshd" doesn't exsists UsePrivilegeSeparation no[/code] You can start sshd with the command: Code: [code]/usr/arm/sbin/sshd
And you will be able to connect to port 2222 with ssh!
Step 10: Setting sshd up as a service started at boot
I would like to discuss this eventuality with you guys. Is there anybody who has experience with setting up services on the DroboFS? Has anybody already done it?