Bug 450891 - Konsole SSH Manager does not parse options from ssh config file properly
Summary: Konsole SSH Manager does not parse options from ssh config file properly
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: sshmanager (show other bugs)
Version: 21.12.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-26 21:11 UTC by ioo+kde
Modified: 2025-03-20 22:20 UTC (History)
2 users (show)

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


Attachments
attachment-20841-0.html (3.19 KB, text/html)
2022-02-27 11:18 UTC, tcanabrava
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ioo+kde 2022-02-26 21:11:51 UTC
SUMMARY
Konsole SSH Manager does not parse directives from ssh config file properly. Opening the SSH Manager plugin and pressing "Import" button does successfully import the host list from ~/.ssh/config however only the user and host name are successfully imported.

STEPS TO REPRODUCE
Example 1 from ~/.ssh/config

Host myhost
    HostName myhost.com
    User myuser
    Port 3000

Result when clicking on the myhost entry in SSH Manager:

ssh myhost.com
ssh: connect to host myhost.com port 22: Connection refused

Here the SSH plugin failed to parse the "Port" directive correctly.

Example 2:

Host pi
    HostName myhost2
    User myuser2
    IdentityFile ~/.ssh/id_rsa

Result when clicking on the myhost2 entry:

ssh myhost2.com
ssh: connect to host myhost2.com: Permission denied (publickey).

Here the SSH plugin failed to parse "IdentityFile" directive correctly.

EXPECTED RESULT
The expected result is that the ssh plugin will parse each host entry and use the option directives correctly, by ignoring them, this plugin is not useful.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 5.24
KDE Plasma Version: 5.24.1
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Comment 1 tcanabrava 2022-02-27 11:18:44 UTC
Created attachment 147165 [details]
attachment-20841-0.html

Aha, sorry for that.
I’ll fix that today, looks easy.

Le sam. 26 févr. 2022 à 22:12, <bugzilla_noreply@kde.org> a écrit :

> https://bugs.kde.org/show_bug.cgi?id=450891
>
>             Bug ID: 450891
>            Summary: Konsole SSH Manager does not parse options from ssh
>                     config file properly
>            Product: konsole
>            Version: 21.12.2
>           Platform: Neon Packages
>                 OS: Linux
>             Status: REPORTED
>           Severity: normal
>           Priority: NOR
>          Component: sshmanager
>           Assignee: konsole-devel@kde.org
>           Reporter: ioo+kde@posteo.net
>   Target Milestone: ---
>
> SUMMARY
> Konsole SSH Manager does not parse directives from ssh config file
> properly.
> Opening the SSH Manager plugin and pressing "Import" button does
> successfully
> import the host list from ~/.ssh/config however only the user and host
> name are
> successfully imported.
>
> STEPS TO REPRODUCE
> Example 1 from ~/.ssh/config
>
> Host myhost
>     HostName myhost.com
>     User myuser
>     Port 3000
>
> Result when clicking on the myhost entry in SSH Manager:
>
> ssh myhost.com
> ssh: connect to host myhost.com port 22: Connection refused
>
> Here the SSH plugin failed to parse the "Port" directive correctly.
>
> Example 2:
>
> Host pi
>     HostName myhost2
>     User myuser2
>     IdentityFile ~/.ssh/id_rsa
>
> Result when clicking on the myhost2 entry:
>
> ssh myhost2.com
> ssh: connect to host myhost2.com: Permission denied (publickey).
>
> Here the SSH plugin failed to parse "IdentityFile" directive correctly.
>
> EXPECTED RESULT
> The expected result is that the ssh plugin will parse each host entry and
> use
> the option directives correctly, by ignoring them, this plugin is not
> useful.
>
> SOFTWARE/OS VERSIONS
> Linux/KDE Plasma: KDE Neon 5.24
> KDE Plasma Version: 5.24.1
> KDE Frameworks Version: 5.91.0
> Qt Version: 5.15.3
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
Comment 2 Yaron Shahrabani 2024-12-30 07:15:21 UTC
I'm experiencing the exact same behavior with 24.08.1.

The values appear in the SSH plugin pane but are not used for the command, only the hostname is used.
Comment 3 Yaron Shahrabani 2025-01-01 08:22:55 UTC
I created a patch which was merged by the developer, it should be included in the next version, please help with testing and validation:
https://invent.kde.org/utilities/konsole/-/merge_requests/1055

We will close this after the fix is out to the public.

Thanks.
Comment 4 Bug Janitor Service 2025-01-11 12:58:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/1057
Comment 5 A. B. Salman 2025-03-20 02:34:03 UTC
Potential fix for some of the cases
Ensure all Konsole instances and windows are closed
sudo nano /home/$USER/.config/konsolesshconfig 
If you see anywhere
profileName=Don't Change
remove apostrophe (') from Don't Change 
or names or profilenames
and make sure you use absolute paths
Comment 6 A. B. Salman 2025-03-20 22:20:02 UTC
(In reply to A. B. Salman from comment #5)
> Potential fix for some of the cases
> Ensure all Konsole instances and windows are closed
> sudo nano /home/$USER/.config/konsolesshconfig 
> If you see anywhere
> profileName=Don't Change
> remove apostrophe (') from Don't Change 
> or names or profilenames
> and make sure you use absolute paths

Also noticed this 
useSshConfig=true
cause the issue of the SSH manager just trying to ssh to host without anything else
Sitting it to false made everything works in the ssh manager