D-Link Forums

The Graveyard - Products No Longer Supported => D-Link Storage => DNS-343 => Topic started by: johnkeye on June 21, 2009, 01:12:56 PM

Title: chrooting to Debian in funplug
Post by: johnkeye on June 21, 2009, 01:12:56 PM
Has anyone had any luck with chrooting to Debian on a DNS-343? I can't get chroot to work at all on the box. I expect that this is because fun_plug (0.5) is compiled for the 323, and not all hardware is analogous on the two devices.
Title: Re: chrooting to Debian in funplug
Post by: Fatman on June 22, 2009, 09:11:04 AM
My understanding (I have never used it) is that all fun_plug does is get you in, so if you are in it's gold.  However I would not be surprised if chroot is not compiled into the DNS be default.  What exactly are you getting for errors, what exactly is your process?
Title: Re: chrooting to Debian in funplug
Post by: johnkeye on June 22, 2009, 11:50:15 AM
Hello Fatman,

Thank you for helping me with this.

I've followed the two first methods listed in this article: http://wiki.dns323.info/howto:chroot_debian (http://wiki.dns323.info/howto:chroot_debian)

Note that the first method is not using chroot at all, I'm only recounting it for completeness.

First method: Downloading debnas
The script properly unpacks linux.tar and creates the directory called linux.
I then try to ssh as myself, then root, and lastly try to telnet in.
Quote from: stdout on local computer
$ ssh john@10.0.23.2
ssh: connect to host 10.0.23.2 port 22: Connection refused
$ ssh root@10.0.23.2
ssh: connect to host 10.0.23.2 port 22: Connection refused
$ telnet 10.0.23.2
Trying 10.0.23.2...
telnet: connect to address 10.0.23.2: Connection refused
telnet: Unable to connect to remote host

Second method: Proper chroot'ing
As I mentioned, I'm using ffp 0.5. Both telnetd and sshd are working properly.

I've downloaded and unarchived Debian Etch, though that last bit of information turns out to be beside the point, as I can't chroot anything; I keep getting 'Illegal Instruction'.
***
Quote from: stdout on DNS-343
bash-3.2# /ffp/bin/busybox chroot /mnt/HD_a2/etch /bin/bash
Illegal instruction
My first assumption was that there was something wrong with the /mnt/HD_a2/etch/bin/bash, so I tried fetching Sarge, with the same result.
Oddly enough, I can't get it to execute the "local" bash with chroot, but that's with a completely different error:
Quote from: stdout on DNS-343
bash-3.2# which bash
/ffp/bin/bash
bash-3.2# /ffp/bin/busybox chroot /ffp/bin/ bash
chroot: cannot execute bash: No such file or directory

I'd try to crosscompile from the bottom up, but since the source for 1.02+ isn't available, and I'd prefer not going back to 1.01, I'd prefer not to go that route.
Title: Re: chrooting to Debian in funplug
Post by: Fatman on June 22, 2009, 12:32:55 PM
your shell has to be relative to your new root path.  the problem is that the debian you have downloaded is compiled for a different processor.