# Ash: /usr/libexec/sftp-server: not found when using scp

**URL:** <https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772>\
**Category:** Installing and Using OpenWrt\
**Created:** [April 21, 2022, 9:51am UTC](https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772 "2022-04-21T09:51:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hucste](https://forum.openwrt.org/user_avatar/forum.openwrt.org/hucste/32/18071_2.png) [@hucste](https://forum.openwrt.org/u/hucste)\
**Post date:** [April 21, 2022, 9:51am UTC](https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772/1 "2022-04-21T09:51:05Z")

</div>

Hi.  
My WRT router: **OpenWrt 21.02.2, r16495-bf0c965af0**  
_(a Xiaomi Redmi AC2100)_

Before attempting the sysupgrade to 21.02.3, I backup my system, by:  
`sysupgrade -b /tmp/backup-${HOSTNAME}-$(date +%F).tar.gz`

Since my station, on Devuan Ceres, I use `scp` command to retrieve this backup, like:

```nohighlight
$ scp router:/tmp/backup-***-2022-04-21.tar.gz .
ash: /usr/libexec/sftp-server: not found
scp: Connection closed

```

Result: I cant get this file. Why?  
_(On the previous 21.02.1, I dont had this problem)_

---

<div class="post-metadata">

**Author:** ![lleachii](https://forum.openwrt.org/letter_avatar/lleachii/32/5_5575768a8748004e209b776fc1b2916d.png) [@lleachii](https://forum.openwrt.org/u/lleachii)\
**Post date:** [April 21, 2022, 4:13pm UTC](https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772/2 "2022-04-21T16:13:19Z")

</div>

> [@hucste](#):
>
> `ash: /usr/libexec/sftp-server: not found`

> [@hucste](#):
>
> Why?

Install the software on your computer.

---

<div class="post-metadata">

**Author:** ![colo](https://forum.openwrt.org/letter_avatar/colo/32/5_5575768a8748004e209b776fc1b2916d.png) [@colo](https://forum.openwrt.org/u/colo)\
**Post date:** [April 21, 2022, 5:46pm UTC](https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772/3 "2022-04-21T17:46:14Z")

</div>

This is a consequence of your client machine using a very recent OpenSSH release (9.0 - check [https://www.openssh.com/txt/release-9.0](https://www.openssh.com/txt/release-9.0) for more info), which changes the `scp` program to use the SFTP protocol under the hood, which vanilla OpenWrt/dropbear installations do not support. To work around the problem on the client side, use the new `-O` (that is an uppercase letter "o") switch when invoking `scp`, which will cause it to fall back to the legacy behavior.

---

<div class="post-metadata">

**Author:** ![hucste](https://forum.openwrt.org/user_avatar/forum.openwrt.org/hucste/32/18071_2.png) [@hucste](https://forum.openwrt.org/u/hucste)\
**Post date:** [April 22, 2022, 10:39am UTC](https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772/4 "2022-04-22T10:39:29Z")

</div>

@colo: right!

```nohighlight
$ scp -O router:/tmp/backup-***-2022-04-21.tar.gz $(pwd)
backup-***-2022-04-21.tar.gz         

```

Thanks! 😃  
_(now, I go to continue the upgrade — I'm happy)_

---

<div class="post-metadata">

**Author:** ![system](https://forum.openwrt.org/uploads/default/original/3X/7/4/740520c71f00039bbf001045c682f0ecb25e905a.png) [@system](https://forum.openwrt.org/u/system)\
**Post date:** [May 2, 2022, 10:39am UTC](https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772/5 "2022-05-02T10:39:59Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
