SchoofsKelvin / vscode-sshfs

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

Problem connecting using two-factor auth #135

Closed josieoharrow closed 4 years ago

josieoharrow commented 5 years ago

It seems like this doesn't work well with my two-factor auth. Before using Duo, my config worked marvelously. Now, I receive a simple prompt for my two-factor auth action but when I accept from my phone, I receive an error that says: "Error connecting to ssh fs [server]: No response from server."

SchoofsKelvin commented 5 years ago

Did this work in the past? If so, which version worked and from which version did it stop working?

Could it just be that the logon attempt times out? By default, the extension (or more precisely, the underlying ssh2 library I use) waits 20 seconds for the SSH handshake to complete. If you want to increase this value, open the config's file (User/Workspace settings.json if you're not using a separate file) and add "readyTimeout": 60000 for e.g. 60 seconds.

zeeshansayyed commented 5 years ago

@SchoofsKelvin I am facing a similar problem. And I can confirm that it worked well last month. I am sorry, I really do not remember the version when it did.

Even when it used to work a couple of months ago, it would take a couple of tries to get the connection established. But now, it gives the above-posted error. I would still like to mention that I once braved trying 10-15 times in a row and it connected. So it does work rarely, which makes this weird.

ouija commented 5 years ago

I've recently enabled Google Authenticator via SSH and am having this same issue, where I changed the password to prompt (and it does) but I have to enter the user password twice, then it prompts for the Google Authenticator code, and then says Error while connecting, No response from server.

Any help is appreciated :)

Update: Could it be related to this somehow? https://github.com/microsoft/vscode-remote-release/issues/642 https://code.visualstudio.com/docs/remote/troubleshooting

You may be prompted to enter this information multiple times due to vscode-remote-release#642. On macOS and Linux, you can avoid this problem by enabling the ControlMaster feature on your local machine so that OpenSSH runs multiple SSH sessions over a single connection.

SchoofsKelvin commented 5 years ago

There was an issue (#110) a while back that could result in prompting for the password twice, but that had been resolved. Could it be that the server is actually prompting for the password twice? If possible, having your Output > ssh-fs might give me more clues.

ouija commented 5 years ago

I was also having similar issues with FileZilla and being prompted constantly for the two-factor auth, so I opted to disable it entirely and follow your adivce on another thread by simply using a private key instead :)

SchoofsKelvin commented 5 years ago

@ouija so it seems like your issue was with the 2FA setup, not the extension

Still, for the other people it might actually be an issue with the extension, so I'll keep this issue open for now. Having log files (Output > ssh-fs) could be useful.

Dekadinious commented 5 months ago

I was also having similar issues with FileZilla and being prompted constantly for the two-factor auth, so I opted to disable it entirely and follow your adivce on another thread by simply using a private key instead :)

Late to the party here, but for anyone finding this thread: You have to set max connections in FileZilla to 1 to avoid it trying to open new connections all the time to avoid being prompted for 2FA constantly.