OpenSSH (including daemon) for OpenLink

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 02:29, 9 November 2006 by (Talk) (Startscript (/etc/init.d/sshd))

Jump to: navigation, search

This article based on work done by Frontalot on



This project offers OpenSSH (including daemon), precompiled and packaged for the PPC LinkStation. The OpenSSH[1] package is intended for people who want to upgrade from Dropbear[2][3] to a more full-featured SSH daemon. This way you can use a client like PuTTY or FileZilla for terminal and file transfer. You can even tunnel[4] other protocols like VNC[5] and Samba[6] through SSH to make them secure. This package requires that you have installed the OpenLink or FreeLink firmware. You may download version 3.9p1 from the downloads area here. You may want to use this version[7] "it contains the original tarball plus an installation script (not yet widely tested, but at least from that you can see the requirements)" referred to by Izzy in this forum [8]. Or, get version 4.3p2 from here.

Programs included

The OpenSSH suite includes the following tools:[9]

scp .
  • ssh-keygen, a tool to generate the RSA and DSA keys that are used for user and host authentication:
ssh-keygen -t rsa
  • ssh-agent, a small daemon that can hold copies of public keys and use them to sign authentication challenges, avoiding the need to enter passphrases every time they are used:
eval `ssh-agent`
  • ssh-add, a tool to load keys into, or delete keys from a running ssh-agent:
  • ssh-keyscan, which scans a list of hosts and collects their public keys:
ssh-keyscan -t rsa
  • sftp-server, the sftp server subsystem (normally run directly by sshd)
  • ssh-keysign, a setuid helper program that signs "hostbased" authentication challenges using the host's private keys (normally executed directly by ssh)

Installation Instructions

FreeLink (Debian)

  • Install the OpenSSH package using apt-get. If prompted, select SSH version 2. Use the command:[10]
apt-get install ssh

OpenLink (PowerPC)

A complete OpenSSH-4.3p2-package is available at mindbenders-page, install it by:

cd /
tar xzvf OpenSSH-4.3p2_ppc.tar.gz

Startscript (/etc/init.d/sshd)

1) The /etc/init.d/sshd needs to be modified by adding the following lines to startup block.

if [ ! -d /var/empty ]; then
mkdir /var/empty

If the modification is not done, every time SSH is stopped and restarted, it will complain the the /var/empty directory already exists.

2) One must also remember to create user named "sshd".

mkdir /var/empty
chown root:sys /var/empty
chmod 755 /var/empty
groupadd sshd
useradd sshd -g sshd -c 'sshd privsep' -d /var/empty 
chown root:root sshd
ln -s /etc/init.d/sshd /etc/rc.d/rc2.d/S07sshd

3) You should be able to connect via ssh after reboot or if you start

/etc/init.d/sshd start


OpenLink (MIPSel)

This is generic and probably would work for any flavor LinkStation[11]

to be able to compile you have to meet the following prerequisites:

  1. Flashed your LinkStation with OpenLink
  2. Installed the mipsel-development-tools (for the MIPSel LinkStation)

then compiling works that way:

download the source of OpenSSH to a seperate folder that you will use for compiling

cd <folder_for_compiling> 
tar xzvf openssh-4.3p2.tar.gz 
cd openssh-4.3p2 
make install

the ssh-keys are generated automatically in the installation process. there are two things that have to done additionally.

Startscript (/etc/init.d/sshd)

1) you have to manually create a startscript for OpenSSH which is stored at


or you use this one (/var/empty has to be created each time at start):

#! /bin/sh
export USER="root"
    if [ ! -d /var/empty ]; then
        mkdir /var/empty
    su - $USER -c"/usr/local/sbin/sshd"
    su - $USER -c"killall sshd"
case "$1" in
        echo -n "Starting sshd: "
        echo -n "Stopping sshd "
        echo -n "Restarting sshd "
        echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
        exit 1
exit 0

2) you have to make sshd is started automatically after shutdown/reboot. do this by executing

ln -s /etc/init.d/sshd /etc/init.d/rc.d/rc2.d/S07sshd

afterwards OpenSSH is ready for action.


  1. - OpenSSH a FREE version of the SSH connectivity tools
  2. Dropbear package designed specifically for the MIPSel LinkStation
  3. Dropbear package for the PPC LinkStation
  4. - Tunneling Explained
  5. - Tunneling VNC over SSH with PuTTY
  6. - Breaking Firewalls with OpenSSH and PuTTY
  7. openssh-3.9p1-05b.tgz - from Qumran Cave FileBase
  8. The Linkstation Community Forum / Everything else / - Mediawiki is online
  9. OpenSSH - From the WikiPedia
  10. Convert from telnet to SSH (both OpenSSH and Dropbear)
  11. The Linkstation Community Forum / Linkstation 2 (mips) / Secure FTP for a Noob