DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-05-08 17:16:57

map7
New member
Registered: 2008-05-08
Posts: 1

Start openssh

I'm using funplug 0.4, then ipkg, then openssh through ipkg.

I want to use openssh instead of dropbear so that i can connect to a ssh using an rsa public key.

The problem is I cannot start it.  On the wiki it says to start it through 'sh /ffp/start/sshd.sh start' but I don't have an /ffp directory.  I do have a /opt/etc/init.d/S40sshd file but it requires $SSHD_ENABLE to be set to yes. 

Where do I set this environment variable?

Offline

 

#2 2008-05-08 18:18:33

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Start openssh

dropbear supports public key authentication, too. /ffp is only present in the 0.5 funplug.

Offline

 

#3 2008-05-08 18:45:13

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Start openssh

Look in /opt/etc/init.d for the optware startup scripts, there should be one for openssh.

You could copy that to your /mnt/HD_a2/fun_plug.d/start folder. (Only minor mods needed, if any?)

Unfortunately, when I started openssh server and connected, I then had to type in a secret key:
5784468

This unlocks the busybox shell that is built in to the DLink firmware.

fonz - can you offer a clue about how I could hack the openssh server to do this automatically, or tweak the configuration so that the more up-to-date busybox included in your fun_plug 0.4 is used instead?

Last edited by sjmac (2008-05-08 18:54:20)

Offline

 

#4 2008-05-08 18:49:47

bzhou
Member
Registered: 2008-02-15
Posts: 171

Re: Start openssh

map7 wrote:

I'm using funplug 0.4, then ipkg, then openssh through ipkg.

I want to use openssh instead of dropbear so that i can connect to a ssh using an rsa public key.

The problem is I cannot start it.  On the wiki it says to start it through 'sh /ffp/start/sshd.sh start' but I don't have an /ffp directory.  I do have a /opt/etc/init.d/S40sshd file but it requires $SSHD_ENABLE to be set to yes. 

Where do I set this environment variable?

Code:

# cat /opt/etc/default/openssh
SSHD_ENABLE=yes
SSHD_NO_PID_KILLALL=/opt/sbin/sshd

It is sourced at the very beginning of /opt/etc/init.d/S40sshd

Offline

 

#5 2008-05-08 18:56:16

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Start openssh

sjmac wrote:

Unfortunately, when I started openssh server and connected, I then had to type in a secret key:
5784468

Change your login-shell, patch /etc/passwd, whatever you like.

Here's a script to patch /etc/passwd. It's included in 0.5.
http://dns323.kood.org/forum/p13033-200 … tml#p13033

Another option is to do this per user (needs usermod from shadow package, included in 0.5) and make it permanent. The example is for home dir, but works similarly for login-shell:
http://dns323.kood.org/forum/p13798-200 … tml#p13798

Offline

 

#6 2008-05-08 18:57:39

bzhou
Member
Registered: 2008-02-15
Posts: 171

Re: Start openssh

sjmac wrote:

Look in /opt/etc/init.d for the optware startup scripts, there should be one for openssh.

You could copy that to your /mnt/HD_a2/fun_plug.d/start folder. (Only minor mods needed, if any?)

Unfortunately, when I started openssh server and connected, I then had to type in a secret key:
5784468

This unlocks the built in busybox shell.

fonz - can you offer a clue about how I could hack the openssh server to do this automatically, or tweak the configuration so that the more up-to-date busybox included in your fun_plug 0.4 is used instead?

On optware platforms, I usually edit /etc/passwd and set the shell of normal user to /opt/bin/bash. Sometimes I also need to edit /etc/shells to add /opt/bin/bash there.
There're also quite recent busybox, dash, rc, tcsh, zsh available in the feed.

See http://trac.nslu2-linux.org/optware/bro … rc.optware on how to invoke all the start scripts in /opt/etc/init.d

Offline

 

#7 2008-05-08 19:28:15

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Start openssh

fonz wrote:

Change your login-shell, patch /etc/passwd, whatever you like.

So, to use the fun_plug 0.4 busybox, something like this?

Code:

    # replace /bin/sh with /mnt/HD_a2/fun_plug.d/bin/sh
    sed -i 's@:/bin/sh$@:/mnt/HD_a2/fun_plug.d/bin/sh@' /etc/passwd

Is the HD_a2 consistent, so is HD_a4 ever "the big partition"?

Or someone could make the optware openssh depend on the optware busybox on the DNS323, and use /opt/bin/sh all the time.

BTW, does anyone have any experience that says that bash is too heavy for the DNS323? Or know how much space/CPU effort BusyBox saves?

Offline

 

#8 2008-05-08 20:51:58

bzhou
Member
Registered: 2008-02-15
Posts: 171

Re: Start openssh

sjmac wrote:

Or someone could make the optware openssh depend on the optware busybox on the DNS323, and use /opt/bin/sh all the time.

BTW, does anyone have any experience that says that bash is too heavy for the DNS323? Or know how much space/CPU effort BusyBox saves?

I don't think that's a good idea. The openssh package should use whatever shell the user likes.

Even for nslu2 bash is not too heavy, it should be fine for dns-323.

Offline

 

#9 2008-05-08 23:11:09

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Start openssh

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB