当前位置: 首页 > news >正文

[openwrt] ash: /usr/libexec/sftp-server: not found scp: Connection closed

 

 scp luci-app-openclash_0.47.028_all.ipk root@10.10.2.3:/root

root@10.10.2.3's password:

ash: /usr/libexec/sftp-server: not found

scp: Connection closed

 

 

The error "ash: /usr/libexec/sftp-server: not found" followed by "scp: Connection closed" occurs because your client machine (the computer you are running the scp command from) is using a newer version of OpenSSH (typically v9.0 or later).

Newer OpenSSH clients use the SFTP protocol by default for scp transfers, but the OpenWrt router uses the lightweight Dropbear SSH server, which typically only supports the legacy SCP protocol and does not include the separate sftp-server binary required by the new clients.

You have two main solutions: the easy client-side fix or the OpenWrt package fix.


 

1. Easy Fix: Use the Legacy SCP Protocol (Recommended) ✅

 

The simplest and most immediate fix is to tell your client's scp command to fall back to the old, legacy SCP protocol by adding the -O (uppercase 'o') flag.

Your original command:

Bash
 
scp luci-app-openclash_0.47.028_all.ipk root@10.10.1.3:/root

The fixed command:

Bash
 
scp -O luci-app-openclash_0.47.028_all.ipk root@10.10.1.3:/root

This forces the client to use the older, universally supported SCP transfer method, which works with the default Dropbear server on OpenWrt.


 

2. OpenWrt Fix: Install the SFTP Server 📦

 

If you prefer to enable the newer SFTP protocol on your router (useful for graphical SFTP clients like WinSCP or FileZilla), you need to install the openssh-sftp-server package on your OpenWrt router.

  • Step 1: SSH into your OpenWrt router.

    Bash
     
    ssh root@10.10.1.3
    
  • Step 2: Update packages and install the SFTP server.

    (You must have a working internet connection for this.)

    Bash
     
    opkg update
    opkg install openssh-sftp-server
    

    If opkg update fails due to an SSL error, you may need to resolve that first (e.g., check your router's date/time) or temporarily use opkg update --no-check-certificate.

  • Step 3: Log out of the router and try your original scp command again.

    Bash
     
    exit
    scp luci-app-openclash_0.47.028_all.ipk root@10.10.1.3:/root
    

With the sftp-server package installed, your modern scp client will successfully find the necessary binary to complete the transfer using the SFTP protocol.

Next Step: Please try the -O flag fix first. Let me know if that works, or if you need assistance installing the package on your router.

 

http://www.zskr.cn/news/39111.html

相关文章:

  • [openwrt]OpenWRT换成清华源
  • 2025年11月学生平板品牌推荐:全维度评测榜看清北直播课与AI题库
  • 2025年11月卖得好的学习机品牌推荐:家长榜评价
  • 2025年11月卖得好的学习机品牌推荐:实力榜排行与真实评价汇总
  • 2025年11月适合小学生的学习机品牌推荐:最新榜单对比评测与真实口碑排行
  • 2025年北京分家析产律师事务所权威推荐榜:专业房产分割与遗产继承法律服务口碑之选
  • window下安装python解释器和python的编辑器pycharm
  • 2025年11月太空舱铝板生产厂家推荐排行:专业品牌口碑评测报告
  • [Flink/Hologres/汽车] 理想汽车:基于 Hologres + Flink 构建万亿级车联网信号实时分析平台 [转]
  • openssl 3和qt5好像打架哎
  • 给一个百分制成绩,要求输出成绩等级‘A,B,C,D,E
  • 大模型应用开发技术路线(上):从概念到RAG实战,这套方法论让我从0到1落地企业级AI应用
  • 20251103 之所思 - 人生如梦
  • COMSOL Multiphysics 6.3 软件下载安装教程(包含许可证设置),从获取安装包到成功启动
  • 11月3日
  • 每日收货
  • 2025.11.03 正睿
  • c++虚函数与纯虚函数解析
  • 杂谈:关于java帝国的一些内容
  • 11月3日日记
  • 概率论练习
  • [linux]记账工具-监控用户活动
  • 10-31 题
  • STM32学习之概念——仿真器、调试器、下载器
  • 洛谷 P3273
  • 好久没来了
  • 【入门】使用Node.js开发一个MCP服务器
  • AgenticSeek:完全本地的AI助手,保护隐私的智能代理
  • CSP-S 2025 题解
  • 洛谷 P11190