OpenSSH (including daemon) for OpenLink

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 03:30, 5 August 2006 by Ramuk (Talk | contribs)

Jump to: navigation, search

This article based on work done by Frontalot on Linkstationwiki.org

190px-Openssh.gif

Contents

Background

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 the latest version from the downloads area here. Or, 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]

Installation Instructions

FreeLink (Debian)

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

OpenLink (PowerPC)

OpenSSH-4.3p2

A complete OpenSSH-4.3p2-package is available at mindbenders-page: OpenSSH-4.3p2_ppc.tar.gz Install it by

cd /
wget http://www.unet.univie.ac.at/~a0025690/ppc-binaries/OpenSSH-4.3p2_ppc.tar.gz
tar xzvf OpenSSH-4.3p2_ppc.tar.gz
/usr/local/etc/create_keys.sh

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

/etc/init.d/sshd start

manually.

Also, the sshd needs to be modified by adding the following lines to startup block.

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

If the modification is not done, every time SSH is stopped and restarted, it will complain the the /var/empty directory already exists. One must also remember to create user named "sshd".

OpenLink (MIPSel)

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

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> 
wget ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-4.3p2.tar.gz 
tar xzvf openssh-4.3p2.tar.gz 
cd openssh-4.3p2 
./configure 
make 
make install

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

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

/etc/init.d/sshd

or you use this one:

#! /bin/sh
export USER="root"
NAME=ssh
start()
{
    if [ ! -d /var/empty ]; then
        mkdir /var/empty
    fi  
    su - $USER -c"/usr/local/sbin/sshd"
}
stop()
{
    su - $USER -c"killall sshd"
}
case "$1" in
    start)
        echo -n "Starting sshd: "
        start
        ;;
    stop)
        echo -n "Stopping sshd "
        stop
        ;;
    restart)
        echo -n "Restarting sshd "
        stop
        start
        ;;
    *)
        echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
        exit 1
        ;;
esac
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.


References

  1. http://www.openssh.com/ - 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. http://www.ssh.com/support/documentation/online/ssh/winhelp/32/Tunneling_Explained.html - Tunneling Explained
  5. http://martybugs.net/smoothwall/puttyvnc.cgi - Tunneling VNC over SSH with PuTTY
  6. http://souptonuts.sourceforge.net/sshtips.htm - Breaking Firewalls with OpenSSH and PuTTY
  7. openssh-3.9p1-05b.tgz - from Qumran Cave FileBase
  8. The Linkstation Community Forum / Everything else / www.linkstationwiki.net - Mediawiki is online
  9. Convert from telnet to SSH (both OpenSSH and Dropbear)
  10. The Linkstation Community Forum / Linkstation 2 (mips) / Secure FTP for a Noob