Skip to content
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

Support SSHClient.authPassword on FreeBSD #815

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

kegelh
Copy link
Contributor

@kegelh kegelh commented Sep 18, 2022

FreeBSD "keyboard-interactive" prompt is "Password for user@host:"

FreeBSD "keyboard-interactive" prompt is "Password for user@host:"
@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2022

Codecov Report

Merging #815 (8fc6f1f) into master (d5d6096) will increase coverage by 0.22%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #815      +/-   ##
============================================
+ Coverage     64.65%   64.88%   +0.22%     
- Complexity     1461     1468       +7     
============================================
  Files           210      210              
  Lines          8537     8537              
  Branches        781      781              
============================================
+ Hits           5520     5539      +19     
+ Misses         2606     2591      -15     
+ Partials        411      407       -4     
Impacted Files Coverage Δ
...sshj/userauth/method/PasswordResponseProvider.java 94.73% <100.00%> (+5.26%) ⬆️
...main/java/net/schmizz/sshj/xfer/scp/SCPEngine.java 73.01% <0.00%> (-3.18%) ⬇️
...java/net/schmizz/sshj/transport/TransportImpl.java 66.11% <0.00%> (+0.82%) ⬆️
...zz/sshj/connection/channel/ChannelInputStream.java 77.27% <0.00%> (+1.51%) ⬆️
...va/net/schmizz/sshj/connection/ConnectionImpl.java 59.34% <0.00%> (+3.25%) ⬆️
.../main/java/net/schmizz/sshj/sftp/PacketReader.java 95.74% <0.00%> (+4.25%) ⬆️
...a/net/schmizz/sshj/userauth/password/Resource.java 50.00% <0.00%> (+8.33%) ⬆️
...t/schmizz/sshj/connection/ConnectionException.java 33.33% <0.00%> (+11.11%) ⬆️
...ain/java/net/schmizz/sshj/common/SSHException.java 74.19% <0.00%> (+12.90%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kegelh kegelh marked this pull request as ready for review September 18, 2022 11:45
@vladimirlagunov
Copy link
Contributor

However, Linux-PAM sends the message Password: . By the way, old ProFTPd versions from Debian used to localize PAM messages sent over SSH.

@kegelh
Copy link
Contributor Author

kegelh commented Sep 19, 2022

All previous prompts are still matched, so "Password: " from Linux continues to work. It would just match the default remote PAM prompt of FreeBSD, too.

Everyone can initialize AuthKeyboardInteractive with a PasswordResponseProvider with their own pattern (this is what we currently do), so this change is not really necessary.

I just thought it would be nice to share this so other users wouldn't have to find this out when trying to connect to FreeBSD. The "password" method is disabled by default on FreeBSD, so "keyboard-interactive" is used for password authentication.

@hierynomus
Copy link
Owner

Yes indeed, currently it's already relatively simple to provide your own pattern. Now I'm not against making the pattern more lenient, but let's at least introduce some tests for the different prompts.

@kegelh
Copy link
Contributor Author

kegelh commented Sep 19, 2022

Indeed, I will add a test.

@hierynomus hierynomus merged commit 6e7fb96 into hierynomus:master Sep 19, 2022
@kegelh kegelh deleted the freebsd_password branch September 19, 2022 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants