# Openssh-sftp-client bug

**URL:** <https://forum.openwrt.org/t/openssh-sftp-client-bug/140515>\
**Category:** Installing and Using OpenWrt\
**Created:** [October 22, 2022, 8:50pm UTC](https://forum.openwrt.org/t/openssh-sftp-client-bug/140515 "2022-10-22T20:50:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoarder](https://forum.openwrt.org/letter_avatar/hoarder/32/5_5575768a8748004e209b776fc1b2916d.png) [@hoarder](https://forum.openwrt.org/u/hoarder)\
**Post date:** [October 22, 2022, 8:50pm UTC](https://forum.openwrt.org/t/openssh-sftp-client-bug/140515/1 "2022-10-22T20:50:01Z")

</div>

Hello everyone,

Linksys EA6350V4 with 22.03.1 here.

I have quite a weird bug with sftp client:  
 ![image](https://forum.openwrt.org/uploads/default/original/3X/2/a/2a856237e9fdf1c5adbb4172987c3750baf5032f.png)  
as you can see from the screen snip, when I log in to the sftp server the console doesn't work properly:

- `sftp>` is not there
- when I try to `cd Do<tab>` into Downloads folder, weird thing happens
- I press Enter couple of times and then ctrl+c - shows me all the `sftp>` that were supposed to be there.

I tried sftp locally on the sftp server PC and everything worked as expected. Router was rebooted.

Edit: `lftp sftp://username@ip-address` works flawlessly though, but it's heavy af. I'd prefer simple sftp-client...

---

<div class="post-metadata">

**Author:** ![Fiouz](https://forum.openwrt.org/letter_avatar/fiouz/32/5_5575768a8748004e209b776fc1b2916d.png) [@Fiouz](https://forum.openwrt.org/u/Fiouz)\
**Post date:** [October 23, 2022, 12:58am UTC](https://forum.openwrt.org/t/openssh-sftp-client-bug/140515/2 "2022-10-23T00:58:21Z")

</div>

Maybe [Ash: /usr/libexec/sftp-server: not found when using scp - #3 by colo](https://forum.openwrt.org/t/ash-usr-libexec-sftp-server-not-found-when-using-scp/125772/3) applies (i.e. use _scp/rcp protocol_ instead of _SFTP protocol_), and lftp has automatic fallback to scp/rcp protocol (increasing lftp logging verbosity might confirm that).

---

<div class="post-metadata">

**Author:** ![hoarder](https://forum.openwrt.org/letter_avatar/hoarder/32/5_5575768a8748004e209b776fc1b2916d.png) [@hoarder](https://forum.openwrt.org/u/hoarder)\
**Post date:** [October 23, 2022, 7:41pm UTC](https://forum.openwrt.org/t/openssh-sftp-client-bug/140515/3 "2022-10-23T19:41:55Z")

</div>

hmmm, maybe you are right, versions are different:

```nohighlight
debug1: Local version string SSH-2.0-OpenSSH_8.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.7
debug1: compat_banner: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.7 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002

```

let's see, if it works after update and reboot

---

<div class="post-metadata">

**Author:** ![hoarder](https://forum.openwrt.org/letter_avatar/hoarder/32/5_5575768a8748004e209b776fc1b2916d.png) [@hoarder](https://forum.openwrt.org/u/hoarder)\
**Post date:** [October 23, 2022, 8:51pm UTC](https://forum.openwrt.org/t/openssh-sftp-client-bug/140515/4 "2022-10-23T20:51:44Z")

</div>

here is a verbose of the connection process:

```nohighlight
root@OpenWrt:~# sftp -v username@hostname
OpenSSH_8.9p1, OpenSSL 1.1.1q 5 Jul 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to hostname [hostname] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa_sk type -1
debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_ed25519_sk type -1
debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.7
debug1: compat_banner: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.7 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to hostname:22 as 'username'
debug1: load_hostkeys: fopen /root/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:ISB2CAxeVVNabHf8l9PNCTKnxUqYQtYbeKd/22bOaXk
debug1: load_hostkeys: fopen /root/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'hostname' is known and matches the ED25519 host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /root/.ssh/id_rsa
debug1: Will attempt key: /root/.ssh/id_ecdsa
debug1: Will attempt key: /root/.ssh/id_ecdsa_sk
debug1: Will attempt key: /root/.ssh/id_ed25519
debug1: Will attempt key: /root/.ssh/id_ed25519_sk
debug1: Will attempt key: /root/.ssh/id_xmss
debug1: Will attempt key: /root/.ssh/id_dsa
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ecdsa_sk
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Trying private key: /root/.ssh/id_ed25519_sk
debug1: Trying private key: /root/.ssh/id_xmss
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
username@hostname's password:
Authenticated to hostname ([hostname]:22) using "password".
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching /root/.ssh/known_hosts for hostname / (none)
debug1: client_input_hostkeys: searching /root/.ssh/known_hosts2 for hostname / (none)
debug1: client_input_hostkeys: hostkeys file /root/.ssh/known_hosts2 does not exist
debug1: Sending subsystem: sftp
debug1: client_global_hostkeys_private_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding
debug1: update_known_hosts: known hosts file /root/.ssh/known_hosts2 does not exist
Connected to hostname.

```

except having different OpenSSH versions, I see no problems.

updating openssh on older ubuntu is a bit complicated. Since I have no physical access to the server, I'd prefer to not tinker with ssh config.
