files-community / files-community/Files

Bug: SSHFS connection with public key is asking for credentials

Open
#18,165 10 comments 0 reactions 0 assignees View on GitHub
area - network drives
Dominant language
C#
Stars
45.4k
Forks
2.9k
PR merge metrics
PR metrics pending

Description

### Description

The "Files" app doesn't let me browse to drives that are mounted [SSHFS](https://github.com/winfsp/sshfs-win) shares, it asks for credentials. (This makes no sense, the drives are accessible by drive letter just fine in any other app.)

What makes it worse and what is different from #10462 (which was set as duplicate target for #17262) is that **my SSH connection doesn't even use passwords, it uses an SSH key pair**. There is nothing I could possibly enter into that dialog field to make the connection work. Leaving it empty results in an empty folder being displayed.

(I also don't understand what this has to do with "remembering FTP credentials" as per the issue linked above because _no new connection is made here, no credentials should be needed_, this is a simple access to an existing Drive mounted so the "Files" app has no business asking for any credentials whatsoever!)

Important Note: I assume the "Files" app is trying to reestablish the "network" connection. This will never work, because the drive is mounted with special flags to set the private key. You can't take the network name and try to access it directly, and I don't understand why the app even tries to do that. I didn't write a network path into the app, I wrote a drive letter! (Even if this was a regular network share, imagine what would happen if I would enter different credentials here than I previously did when mounting the share, and the server serves me a different directory tree based on the username... then the "Files" app would disagree about the drive contents with the rest of the system - it makes no sense, sounds like a recipe for disaster!)

### Steps To Reproduce

1. Mount an SSHFS drive with private key, for example using `sshfs-win.exe cmd -o IdentityFile=/cygdrive/c/Users/david/.ssh/id_rsa david@example.com:/home/david U:`
2. Open the drive in Windows Explorer or any other app. Works fine!
3. Open the drive in the "Files" app. Notice it asks for credentials (even though there are none). Entering empty credentials just shows an empty folder.
### Files Version

4.0.24.0

### Windows Version

10.0.26200.7840

### User ID

_No response_

### Log File

Note: The drive in question is `U:`.

[debug.log](https://github.com/user-attachments/files/25328348/debug.log)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.