Skip to content

Authentication method issue #836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kapilgurnani opened this issue Oct 10, 2019 · 8 comments
Closed

Authentication method issue #836

kapilgurnani opened this issue Oct 10, 2019 · 8 comments
Labels

Comments

@kapilgurnani
Copy link

I am getting Authentication method none everytime.
I test server by filezilla on linux

I am getting below value on ctx parameter

domain:null
method:"none"
service:"ssh-connection"
user:"abc"
username:"abc"

@mscdex
Copy link
Owner

mscdex commented Oct 10, 2019

Assuming you mean you're writing a server with ssh2, that's entirely possible for the client to request the 'none' authentication method. That just means it's requesting access without providing any credentials. It's sometimes used by clients to determine what methods are actually usable. You can pass such a list of methods as an array to ctx.reject().

@kapilgurnani
Copy link
Author

I am taking the credentials from filezilla so what can be the solution for this?

@mscdex
Copy link
Owner

mscdex commented Oct 11, 2019

It's entirely up to you how you want to handle a 'none' request. You can accept it, which means the user is allowed in without a password/key/etc. or you can reject it with a list of valid authentication methods like I mentioned.

@kapilgurnani
Copy link
Author

I tried by sending password from filezilla but didn't get any password in ctx.

I were getting this parameters on ctx -
domain:null
method:"none"
service:"ssh-connection"
user:"abc"
username:"abc"

@xMarkusSpringerx
Copy link

xMarkusSpringerx commented Nov 11, 2019

I have the same probelm as @kapilgurnani . I try to connect to the FTP Server with filezilla providing username and password within filezilla. but the SFTP Server responds with none as authentication type. Do you know how to avoid this @mscdex ?

@mscdex
Copy link
Owner

mscdex commented Nov 11, 2019

I don't have any suggestions other than the ones I've already given @xMarkusSpringerx.

@P4sca1
Copy link

P4sca1 commented May 1, 2020

The following code snippet might be useful if you only want to allow login through passwords.
Filezilla will still try to login via 'none' one time but then sends another request using the password.

if (authContext.method !== 'password') {
  return authContext.reject(['password'])
}

@whatl3y
Copy link

whatl3y commented Mar 25, 2021

I felt this needed to be documented since I spent >1 hour trying to figure it out to finally find this issue buried in the issues list. #993

@mscdex mscdex closed this as completed May 29, 2021
benallfree added a commit to benallfree/ssh2 that referenced this issue Aug 20, 2023
Fix to work with more clients such as FileZilla.

mscdex#836 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants