SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
546 stars 36 forks source link

Ask for password if empty? #192

Closed borekb closed 4 years ago

borekb commented 4 years ago

I was confused by the UX as I thought that an empty password would ask me for it (most programs do this). When I was getting

Error while connecting to SSH FS wphosting: All configured authentication methods failed

I thought that I have to store my password in settings.json, which is obviously ugly.

Only later I realized that selecting an explicit \<Prompt> in the config does the trick (it sets "password": true in JSON).

Maybe the extension could ask for password automatically if pwd is empty?

SchoofsKelvin commented 4 years ago

The recommended way of editing/adding configurations is by using the Settings UI, since it has some error checking and is more intuitive, as you noticed.

There isn't a distinct way to detect when the server requires a password or not. The extension does support keyboard-interactive to auto-prompt, but during testing I've had it that some servers don't trigger this. When I wrote the code, I also had issues during testing regarding specifying the authentication methods (password VS private key etc) which played a role, especially when involving an agent.

I'm also not sure whether an empty password should mean it should prompt, or if it shouldn't use a password. I'll look a bit at the code and see if I can improve on the authentication and detecting whether a password is even needed, as the underlying ssh2 library has updated quite a bit since then.

borekb commented 4 years ago

Thanks for the quick response! I actually started from the UI and somehow felt from the label that not providing any password will prompt me for it (probably my mistake).

I realize that this is not easy but thanks for looking into improving the UX anyway!

SchoofsKelvin commented 4 years ago

Detecting when a password is required on the server is still a pain. The UI's Password field is also a dropbox suggesting <Prompt> which will configure it to prompt each time.