How to to get sftp access with dropbear
This is done on top of Kfurge's firmware, with dropbear installed according to his instructions from the optware/oleg repository. This already gives you secure file transfer through scp, but I needed sftp too. This seems easy, but there is a trick : read through the end.
sftp-server is in the openssh package. The easy way to install it is
sudo ipkg update
sudo ipkg install openssh
is also requires openssl and zlib, so :
sudo ipkg install openssl
sudo ipkg install zlib
Now the trick to make it work:
WARNING : Before you do this trick, it's really wise to reactivate telnet access in rc.local, just in case you screw up your dropbear and lock yourself out of your router...
The dropbear version I which got installed following the instructions (0.48.1-1) is hard-coded to launch sftp-server from /usr/libexec while it gets installed on the hdd in /opt/libexec (the standard "optware" path, hence the name). I did not feel like setting up a development environment to recompile my own dropbear version. I did it the lazy and dirty way, simply changing "usr" to "opt" right in the binary, and it worked!
To do this, I transfered the dropbear binary (/opt/sbin/dropbearmulti ; dropbear is just a link to this file) to my Ubuntu pc and used sed:
sed 's/\/usr\/libexe/\/opt\/libexe/g' dropbearmulti > dropbearmod
and then replaced the original binary by the new file, with proper rights.
I saw afterwards that sed comes with busybox, so you should be able to do this trick in place. I didn't try.
Openssh wants to overwrite dropbear exectables
Hi,
I've followed your instructions. However, when I try to install openssh it warns me that it wants to overwrite some dropbear executables, namely ssh.
How should I proceed? Uninstall dropbear, install openssh and re-install dropbear with -force-overwrite so that it can install its own executables?
Regards,
PVarela
problem with sftp / wl500g ??
Hi all,
Sorry to open up an old thread, but I also have a wl-500g:
Quote:
Originally Posted by
shinji257
I didn't even have to do that. On my wl500g router all I did was install openssh-sftp-server and it worked immediately ....
This is what I get via telnet session:
Code:
$ ipkg update
Downloading http://wl500g.dyndns.org/ipkg/Packages
Updated list of available packages in /opt/lib/ipkg/lists/wl500g
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/Packages
Updated list of available packages in /opt/lib/ipkg/lists/unslung
Successfully terminated.
$ ipkg install openssh-sftp-server
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
Cannot find package openssh-sftp-server.
Check the spelling or perhaps run 'ipkg update'
Is this package gone now? Using firmware 1.9.2.7-9...
Thanks...
EDIT: Fixed as per pvarela's instructions in #4, except no patching was needed for me (/usr/sbin/dropbear already pointed to /opt/libexec/sftp-server) :)