Shibby FW - Help SFTP not working with entware, but ok with optware

Discussion in 'Tomato Firmware' started by Sean Rhodes, Apr 27, 2014.

  1. Sean Rhodes

    Sean Rhodes Networkin' Nut Member


    Can someone please help?

    I installed shibbys latest version 117 (tomato-E4200USB-NVRAM60K-1.28.RT-N5x-MIPSR2-117-Mega-VPN) on my router and decided to switch over to entware.

    I used a fresh formatted USB, created my partitions and installed entware OK (had a couple of mount issues due to I think the timing of the init file loading).

    After installing, I updated entware and then installed openssh-sftp-server 6.6p1-1 and all appeared to be fine, the ssh key is accepted, but then I get the following:
    ! sh: /usr/libexec/sftp-server: not found
    and then it closes the connection.

    When I look in the syslog, I'm getting notices from dropbear saying the Pubkey was successful followed by dropbear exited normally, so it looks like dropbear is picking up the connection instead of sftp.

    Can someone please help?
  2. leandroong

    leandroong LI Guru Member

    You seems to be correct. I remember before that I needed that optware, "openssh-sftp-server" to make connect via ssh. My router opkg listing does not have that installed and yet I'm able to connect. Dropbear is doing this connection indeed.

    # Enable sftp, work around
    # Needs 44.5K on /
    if [ ! -e /usr/libexec/sftp-server ] ; then
      opkg update
      opkg -d ram install openssh-sftp-server
      mkdir -p /usr/libexec
      cp /tmp/usr/lib/sftp-server /usr/libexec/
    Last edited: Apr 27, 2014
  3. Sean Rhodes

    Sean Rhodes Networkin' Nut Member

    Thanks, but that doesn't work for me either, when I run the script I get the following error:
    Collected errors:
    * resolve_pkg_dest_list: Unknown dest name: `ram'.
    cp: can't stat '/tmp/usr/lib/sftp-server': No such file or directory
    It looks like it doesn't understand the ram command.

    Is there anyway to extract it to another location and then move it back?
  4. leandroong

    leandroong LI Guru Member

    This appears to be entware repo problem, the file your looking on should appear on "/opt/usr/lib" and not "/usr/libexec" (read only). Try make a bug report on

    edit: another solution. Use ipkg optware, they may have correct repo for this. Take note that you need to remove entware and install optware before you can install it.
    Last edited: Apr 27, 2014
  5. Sean Rhodes

    Sean Rhodes Networkin' Nut Member

    I tried searching for the file and then tried to create a symlink:
    root@Tomato:/tmp/home/root# find / -name sftp-server
    root@Tomato:/tmp/home/root# ln -s /opt/libexec/sftp-server /usr/libexec/sftp-server
    ln: /usr/libexec/sftp-server: Read-only file system
    but that did not work either, and if its read only, then I doubt I can copy the file itself over.

    Is there anything else I could try?
  6. leandroong

    leandroong LI Guru Member

    As I said, this is bug in entware repo and needed to be corrected and recompile.
    Alternative solution, remove entware from USB drive and install optware and use optware repo for that.
  7. leandroong

    leandroong LI Guru Member

    1. format your USB drive or remove entware folder
    2. install optware. "/usr/sbin/"
    3. optware update, "ipkg update", "ipkg upgrade"
    4. install sftp-server, "ipkg install openssh-sftp-server"
  8. Sean Rhodes

    Sean Rhodes Networkin' Nut Member

    Thanks Leandroong,

    I will have to go back to my optware USB, luckily I didn't wipe it.
  9. koitsu

    koitsu Network Guru Member

    Entware support stuff needs to be filed properly with the Entware folks, not through this forum (now that we're at the point where we've determined it's a bug). Can someone please properly file an issue/bug report? Otherwise it's unlikely to expect it to be fixed. :)
  10. ryzhov_al

    ryzhov_al Addicted to LI Member

    Hi, Sean.
    Are you mean dropbear from Tomato? If so, no matter which repo you are using, dropbear will always search sftp binary at /usr/ path.

    If you want to add support Entware/Optware SFTP, you have to patch Tomato sources.
    Last edited: Apr 28, 2014
  11. szpunk

    szpunk LI Guru Member

  12. Sean Rhodes

    Sean Rhodes Networkin' Nut Member

    Thanks for all your help everyone.

    Much appreciated
  13. my_bey

    my_bey Serious Server Member

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice