-
Notifications
You must be signed in to change notification settings - Fork 146
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
Two factor authentication using password and public Key #670
Comments
This is a server side configuration issue. The server should be enforcing that both password and public key are successful, not the client. I do not know how Bitvise configuration works with multiple methods. But OpenSSH works like this: sshd_config
Require public key followed by password, both successful sshd_config
Require one of public key or password successful. The combinations can be more complex and allows for multiple list of combinatorial authentication mehtods. Example from OpenSSH man page
|
We have a SFTP Server which uses both password and publicKey for authentication on Bitvise. Our SftpClient is using jsch 0.2.19. We have incorporated addIdentity and set password on our session. We have also implemented UserInfo, UIKeyboardInteractive in our SFTPUserInfo class, and set the the session with user info as follows:
session.setUserInfo(new SFTPUserInfo(username, password, passphrase);
In our code, the preferredAuthentications we mentioned are
publickey,password,keyboard-interactive
After these changes, we have used a Bitvise SSH Server to check the authentication that's happening. We notice that public key is being used to authenticate, only in the case that public key is invalid, it falls back to password (We think this ordering is due to the order of our preferredAuthentications). Our expectation is that at all times both public key and password are used for two factor authentication.
Is there anything we are missing here to have two factor authentication working?
The text was updated successfully, but these errors were encountered: