Bug 486973 - Unable to remember password for custom prompt
Summary: Unable to remember password for custom prompt
Status: CONFIRMED
Alias: None
Product: ksshaskpass
Classification: Applications
Component: general (other bugs)
Version First Reported In: 6.0.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Jeremy Whiting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-13 15:53 UTC by joelsgp@protonmail.com
Modified: 2025-10-25 18:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
patch to catch kbdinteractive (797 bytes, patch)
2025-10-25 18:27 UTC, Daniel Lysfjord
Details
Add support for FreeBSD and openssh kbdinteractive (801 bytes, patch)
2025-10-25 18:51 UTC, Daniel Lysfjord
Details

Note You need to log in before you can comment on or make changes to this bug.
Description joelsgp@protonmail.com 2024-05-13 15:53:06 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
The usual prompt by sshd is like this:
"user@host's password:"
For some reason, a major compute cluster at my university has a custom prompt like this:
"(user@host) Password:"

So I get a message like this:
"ksshaskpass: Unable to parse phrase "(jm3017@viking.york.ac.uk) Password: ""
and it doesn't save the password.

To fix this would it be possible to have a config file where I can put in a regex format string for the prompt, or could the program default to saving the exact string if it can't parse it?

I don't know how or why this server has the prompt that it does.
If it helps, the server is running "Flight Direct r2023.1 Based on Rocky Linux 8.9".

STEPS TO REPRODUCE
1. Visit a server with a custom password prompt
2. Enter a password and select save password
3. Logoff and connect again

OBSERVED RESULT
Password isn't saved

EXPECTED RESULT
Password is saved


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 6.0-2
KDE Frameworks Version: 
Qt Version: 6.7.0-6

ADDITIONAL INFORMATION
Comment 1 Andriy Gapon 2025-07-24 08:19:53 UTC
I can confirm that this is still an issue in ksshaskpass-6.4.2.
Custom password prompts are not that rare.
Comment 2 Katalin Rebhan 2025-09-29 16:18:00 UTC
> For some reason, a major compute cluster at my university has a custom prompt like this:
> "(user@host) Password:"

This is *not* a custom prompt, far from it, this is indeed the default password prompt for openssh's keyboard-interactive auth method. It's the one that's used with the stock sshd config!
Comment 3 krystof 2025-09-30 13:55:04 UTC
I had the same problem and with help from other people I found the problem is that the ksshaskpass dosent support the keyboard interactive prompt format which is on some distributions like debian disabled (https://manpages.debian.org/unstable/openssh-server/sshd_config.5.en.html). So the solution to fix it is simply to disable the KbdInteractiveAuthentication option.
Comment 4 Daniel Lysfjord 2025-10-25 18:27:17 UTC
Created attachment 186146 [details]
patch to catch kbdinteractive

I grew tired of the lack of support for kbdinteractive, so, here's a patch.
Comment 5 Daniel Lysfjord 2025-10-25 18:51:42 UTC
Created attachment 186148 [details]
Add support for FreeBSD and openssh kbdinteractive

FreeBSD adds a space on the end of the prompt. Update patch to support both with and without space on the end..