SFTP with DD-WRT

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:17, 21 January 2008 (edit)
Swift (Talk | contribs)
(New page: SFTP with DD-WRT ==Requirements== * Although it wouldn't be too hard to make a firmware image that supports SFTP, you'll need a router with enough space to install Optware until someo...)
← Previous diff
Revision as of 21:20, 21 January 2008 (edit) (undo)
Swift (Talk | contribs)

Next diff →
Line 8: Line 8:
# Install the [[Optware]] Dropbear package. # Install the [[Optware]] Dropbear package.
-ipkg-opt install dropbear+ ipkg-opt install dropbear
# Install the [[Optware]] SFTP server package. # Install the [[Optware]] SFTP server package.
-ipkg-opt install openssh-sftp-server+ ipkg-opt install openssh-sftp-server
# Configure /opt/etc/init.d/S51dropbear to set the Dropbear command line arguments you need. # Configure /opt/etc/init.d/S51dropbear to set the Dropbear command line arguments you need.
Line 20: Line 20:
# Modify the executable to use /opt/libexec/sftp-server instead of /usr/libexec/sftp-server. # Modify the executable to use /opt/libexec/sftp-server instead of /usr/libexec/sftp-server.
-perl -pi -e 's/\/usr\/libexec\/sftp-server/\/opt\/libexec\/sftp-server/g' dropbear+ perl -pi -e 's/\/usr\/libexec\/sftp-server/\/opt\/libexec\/sftp-server/g' dropbear
# Copy the modified Dropbear executable into /opt/sbin. (You can overwrite the existing /opt/sbin/dropbear since it's just a symbolic link to /opt/sbin/dropbearmulti.) # Copy the modified Dropbear executable into /opt/sbin. (You can overwrite the existing /opt/sbin/dropbear since it's just a symbolic link to /opt/sbin/dropbearmulti.)
Line 27: Line 27:
# Start the Dropbear server. # Start the Dropbear server.
-/opt/etc/init.d/S51dropbear start+ /opt/etc/init.d/S51dropbear start
# Attempt to connect with an SFTP client. It should work! # Attempt to connect with an SFTP client. It should work!

Revision as of 21:20, 21 January 2008

SFTP with DD-WRT

Contents

Requirements

  • Although it wouldn't be too hard to make a firmware image that supports SFTP, you'll need a router with enough space to install Optware until someone does that.
  • You'll need access to Perl, either using the Optware package on your router or on another machine, to follow this tutorial exactly. You can substitute another utility that can edit binary files if you prefer.

Install the Packages

  1. Install the Optware Dropbear package.
ipkg-opt install dropbear
  1. Install the Optware SFTP server package.
ipkg-opt install openssh-sftp-server
  1. Configure /opt/etc/init.d/S51dropbear to set the Dropbear command line arguments you need.

Modify the Dropbear Executable

  1. If you don't have Perl installed on your router, copy /opt/sbin/dropbear to a machine that does have it. Regardless, make sure that you work with a copy in case something goes wrong.
  2. Modify the executable to use /opt/libexec/sftp-server instead of /usr/libexec/sftp-server.
perl -pi -e 's/\/usr\/libexec\/sftp-server/\/opt\/libexec\/sftp-server/g' dropbear
  1. Copy the modified Dropbear executable into /opt/sbin. (You can overwrite the existing /opt/sbin/dropbear since it's just a symbolic link to /opt/sbin/dropbearmulti.)

Test It

  1. Start the Dropbear server.
/opt/etc/init.d/S51dropbear start
  1. Attempt to connect with an SFTP client. It should work!