Bug 480547

Summary: Cannot connect to remote servers from .ssh/config/ that don't use a resolvable hostname as an identifier
Product: [Frameworks and Libraries] kio-extras Reporter: jan <jan>
Component: SFTPAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kde, krusader-bugs-null, voidpointertonull+bugskdeorg
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description jan 2024-01-30 16:27:47 UTC
STEPS TO REPRODUCE
1. have an external host defined in .ssh/config/
2. use sftp://the_hostname/some/path/

OBSERVED RESULT
Error: Internal Error
Please send a full bug report at https://kde.bugs.org
Could not set host

EXPECTED RESULT
SFTP connection is established.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
It definitely worked before upgrading to 22.04.
The definition in .ssh/config is like
Host the_hostname
    User someuser
    HostName 123.456.654.321
    Port 22

It works on local servers but fails on external ones. `ssh the_hostname` works just fine.
Affected are hosts with underscores and those without.
It works if I set the entry name to something DNS-resolvable.
Comment 1 Pedro V 2024-02-08 14:38:24 UTC
Initially I wanted to just conclude that it's a works for me kind of matter, but although the IP address you provided is not valid, I figured the friendly hostname pattern was deliberate, so I gave that a try.

It turns out that the problem is with the underscore, can reproduce seeing the 3 line error message that way.
The issue doesn't appear without special characters or for example dash being used as a separator.

Can also reproduce the issue with Dolphin, so not likely to be specific to Krusader, it's more likely to be a KIO (slave) problem.

KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Comment 2 Vincent Wilms 2024-02-23 11:28:00 UTC
For me it does not work even without any underscores in the `Host` field:

```
Host contabo
    HostName <my DNS name>
    User root
    IdentityFile ~/.ssh/id_rsa
    RequestTTY yes
    RemoteCommand fish
```

Kubuntu 23.10
KDE-Plasma-Version: 5.27.8
KDE-Frameworks-Version: 5.110.0



When I then use `sftp://contabo` in Krusader it gives me `Failed to resolve hostname contabo`