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 2007-07-19 01:53:05

cyboc
Member
From: Vancouver, BC, Canada
Registered: 2007-07-14
Posts: 27
Website

su with Fonz's FUN-PLUG 0.2

Hi,

I just installed Fonz's FUN-PLUG 0.2. Thanks for that, Fonz!

As per the instructions, I enabled dropbear SSH by chmod'ing dropbear.sh so that it is executable. I am now able to ssh to the box. When prompted to login, I use the same credentials as when I login to the web site (i.e. username: admin). I can't seem to login with username root (I get access denied when I try either a blank password or the same password as admin). I suppose that's a good thing. The real problem is that I can't seem to su to root:

Code:

login as: admin
admin@mercury's password:


BusyBox v1.5.0 (2007-05-06 16:42:17 CEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ su
-sh: su: not found

Hmn, su must not be on the path. Let's look at the path:

Code:

~ $ echo $PATH
/usr/local/bin:/usr/bin:/sbin:/bin

Oh, I see, Fonz's binaries, including su (symlinked to busybox), are not on the path. Okay, let's try again, this time being more explicit:

Code:

~ $ /mnt/HD_a2/fun_plug.d/bin/su
su: applet requires root privileges!

Okay, let's check the permissions:

Code:

~ $ ls -l /mnt/HD_a2/fun_plug.d/bin/su
lrwxrwxrwx    1 root     root            7 Jul 18 13:34 /mnt/HD_a2/fun_plug.d/bin/su -> busybox

Hmn, everyone should be able to execute su.

Please pardon my stupidness. What am I doing wrong? I want to get su to work during ssh session so that I can disable telnet. Please help this pathetic guy.


"If you feel yourself irreplaceable, put a finger in a glass of water. If you leave a hole when you take it out, you truly are irreplaceable."

Offline

 

#2 2007-07-19 02:28:23

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

Re: su with Fonz's FUN-PLUG 0.2

For su, set the suid bit of busybox:

Code:

chmod u+s /mnt/HD_a2/fun_plug.d/bin/busybox

Have you made sure that root has a password? Won't work without, I think.

For the PATH, you can create $HOME/.profile and copy the environment variables from the fun_plug script (BINDIR, ETCDIR, ...)
If the user's $HOME is not on the harddisk (so changes to the home dir are lost on reboot), you can copy one
during system boot.

Alternatively, you can try the 0.3-testing version - the PATH problem should be fixed, and it has a script
to set user home directories to directories on disk (change-homedir.sh). You still need to set a root password,
WingStone has a script that helps here, http://dns323.kood.org/forum/p4873-2007 … html#p4873
But it needs to be extended so that it can fix both /etc/passwd and /etc/shadow.
A script to reliably set the root password (so that it's written to flash) is still missing.

There're quite a few threads discussion the ssh problems with additional infos that might help.

Offline

 

#3 2007-07-19 21:43:42

cyboc
Member
From: Vancouver, BC, Canada
Registered: 2007-07-14
Posts: 27
Website

Re: su with Fonz's FUN-PLUG 0.2

fonz wrote:

A script to reliably set the root password (so that it's written to flash) is still missing.

Fonz, see my latest message in the Removing password restrictions thread, where I talk about CP_passwd_MTD1(). It may provide you with the clues you need to safely write passwords to flash.


"If you feel yourself irreplaceable, put a finger in a glass of water. If you leave a hole when you take it out, you truly are irreplaceable."

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB