# remote: Fall back to SCP if SFTP fails \(\#41255\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/5d359ea2f2d7c79b115bcbddf5a773aacda31a7e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 5d359ea2f2d7c79b115bcbddf5a773aacda31a7e

Requested commit: 5d359ea2f2d7c79b115bcbddf5a773aacda31a7e

Commit: 5d359ea2f2d7c79b115bcbddf5a773aacda31a7e

Tree: 1bda90843f109fe6611011d61ee8f926a68446d2

Author: Jakub Konka

Committer: GitHub

## Message

```
remote: Fall back to SCP if SFTP fails (#41255)

Fixes https://github.com/zed-industries/zed/issues/41260

After experimenting and reading through the implementation of OpenSSH
stack on Windows, it looks like batch mode precludes use of passwords.
In the listing
https://github.com/PowerShell/openssh-portable/blob/b8c08ef9da9450a94a9c5ef717d96a7bd83f3332/sshconnect2.c#L417,
the last field of each `Authmode` struct is a pointer to the config
value that *disables* that particular mode. In this case, `keyboard`
(interactive) and `password` modes are both disabled if batch mode is
used. We should therefore fall back to `scp` if `sftp` fails rather than
to fail outright.

Release Notes:

- N/A
```

## Parents

- [72c6a7450558fc4a1026fa10f846c1236fd9ee27](https://git.cafe/gitcafe/zed/commit/72c6a7450558fc4a1026fa10f846c1236fd9ee27?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/5d359ea2f2d7c79b115bcbddf5a773aacda31a7e?format=markdown)
