Bug 451755 - Can't use RSA identity key file with sftp Network Folder
Summary: Can't use RSA identity key file with sftp Network Folder
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 21.12.3
Platform: Neon Other
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-21 03:09 UTC by ioo+kde
Modified: 2024-02-25 21:33 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ioo+kde 2022-03-21 03:09:50 UTC
SUMMARY
I am setting up a Network connection with Dolphin using the sftp protocol. I have a ~/.ssh/config file with the server information and a server that uses an RSA identity file. When I fill out the information and click "Save & Connect". Dolphin asks me for a password. This is incorrect because I am using an identity file.

If I change the protocol to fish, dolphin prompts me (correctly) for the password of the RSA identity file. So fish works as expected while sftp does not work.


STEPS TO REPRODUCE
1. Open Dolphin
2. Select Remote-Network-Add Network Folder
3. Fill in information for a stanza from the ssh config file with a rsa identity file
4. Select sftp as the protocol.

OBSERVED RESULT
Dolphin incorrectly asks for a password

EXPECTED RESULT
Dolphin will correctly use the identity file when using sftp, the same as it does when selecting the fish protocol.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.24
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Is this bug somehow related to this very old issue in midnight commander: https://midnight-commander.org/ticket/3238

It looks like mc corrected the issue years ago, did Dolphin use this old code?
Comment 1 2wxsy58236r3 2022-03-21 13:03:22 UTC
It works for me and I can use SFTP + RSA key in Dolphin.

Can you please try again (+ check that whether you can connect to the remote machine by `ssh remote_machine_ip` in terminal)? These links may be useful:
https://forum.kde.org/viewtopic.php?f=224&t=162165
https://old.reddit.com/r/X1ExtremeGen2Related/comments/h9cjc0/enable_kde_dolphin_to_open_a_remote_directory/
Comment 2 ioo+kde 2022-03-22 20:01:58 UTC
I have tried this many times.

Here is my .ssh stanza:

Host remotehost
    HostName hostname
    User user
    Port 1000
    IdentityFile ~/.ssh/id_rsa

When I try to setup a sftp connection (Dolphin->Remote->Network->Add New Network Folder->Secure shell (ssh)->Next:

- Enter the information into the form 
- Select protocol "sftp"
-Click "Save and Connect

The dialogue asks me:

Authentication Dialog
Passphrase
Password.

It is asking me for a password for the account it did not recognize I was using an rsa key.

If I select cancel, it returns me to the form,
- Change protocol to fish
- Keep all other settings the same

The dialogue asks me:

SSH Authentication
Enter passphrase for key /home/user/.ssh/id_rsa.

If I enter my key passphrase it works.

** The dialogue box that comes up when selecting sftp is different than when selecting fish. Fish works, sftp does not work.** 

Even though I am using the same server information, when selecting sftp it does not recognize the key. When just changing this protocol to fish it works as expected.

Yes I can connect with the terminal.
Yes the key is in authorized keys.

The problem is quite specific, if I change the protocol from fish to sftp it does not work. With fish it works as expected.
Comment 3 2wxsy58236r3 2022-03-23 06:38:13 UTC
Are you using any SSH agent? [1]

[1] https://wiki.archlinux.org/title/SSH_keys#SSH_agents
Comment 4 ioo+kde 2022-03-23 17:40:53 UTC
Yes I am using whatever the default agent is with KDE Neon (5.24.3), I believe it is the OpenSSH "ssh-agent"

Do you have a good understanding of the issue I am trying to describe? When I use the Dolphin "Add Network Folder" button to try to setup an 'sftp' connection, it doesn't recognize I am using a rsa key and it asks for an account password.

If I use the same button, with the same config stanza (~/.ssh/config) but change the protocol to 'fish' it recognizes and uses the rsa key.

So I can successfully set up a network folder using fish but not using sftp.
Comment 5 2wxsy58236r3 2022-03-24 10:39:03 UTC
Yes, I understand your issue well.

I tried to reproduce your issue by setting up KDE on a _fresh_ install of Arch Linux.
The key is a RSA key, and I used "Add Network Folder" in Dolphin button to setup SFTP connection.

Unfortunately I am unable to reproduce your issue, so perhaps you will have to wait until other users or a developer figures out why this bug happens.
Comment 6 cybea 2022-04-08 15:56:20 UTC
I have the same problem. I am asked for a user password instead of the key password. Using sftp from commandline works fine.

kde-neon: 20.04
plasma: 5.24.4
dolphin: 21.12.3

.ssh/config:
<code>
Host *
        ServerAliveInterval 60
        ServerAliveCountMax 10
        TCPKeepAlive yes

IdentityFile /home/<login>/.ssh/id_ed25519
</code>

<code>
~$ ps x | grep ssh-agent
   2587 ?        Ss     0:00 /usr/bin/ssh-agent /usr/bin/im-launch /usr/bin/startplasma-x11
</code>

Changing protocol to fish asks for key password but fails: "Unable to connect to server. Please check your settings and try again."

<code>
killall ssh-agent
</code>
and having it "<defunct>" does not change anything.
Comment 7 Dobrogi 2022-10-17 19:33:43 UTC
Same here. I use ssh-agent. When trying to log in with commandline ssh, I have no problems but when I use sftp:// in dolphin I'm asked for password. I'm sure it worked with no problems several weeks ago.

Operating System: Manjaro Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 6.0.0-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-9850H CPU @ 2.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
Manufacturer: Dell Inc.
Product Name: Latitude 5501