0

I have the Android SimpleSSHD app installed on my phone. From my Arch Linux desktop I can ssh to my phone from the command line. I can also sftp to my phone from the command line.

However, KDE Dolphin refuses to connect.

I have a ~/.ssh/config file with the following content:

Host GalaxyS8
    HostName 192.168.1.1
    Port     2222
    IdentityFile /home/myuser/.ssh/id_rsa

All of the following commands work in the terminal:

ssh -p 2222 -i /home/myuser/.ssh/id_rsa 192.168.1.1
ssh -p 2222 -i /home/myuser/.ssh/id_rsa [email protected]
ssh GalaxyS8
sftp -o IdentityFile=/home/myuser/.ssh/id_rsa -o Port=2222 192.168.1.1
sftp GalaxyS8

However, none of the following work in Dolphin:

fish://GalaxyS8
sftp://GalaxyS8
sftp://[email protected]:2222
fish://[email protected]:2222

With the last command, Dolphin reports, "Connection to host 192.168.1.1 is broken." While on the phone, SimpleSSHD reports Pubkey auth succeeded and then Disconnect received. No errors are reported on the phone by SimpleSSHD.

So this appears to be a KDE Dolphin issue. I do not see any messages related to this in the systemd logs on the Arch system.

1 Answer 1

1

I got it working with these steps:

  1. Must use sftp:// not fish://

  2. Must type out the full URI such as sftp://[email protected]:2222/sdcard/path/

  3. Must have a ~/.ssh/config file with the proper values to use a private key file (passwordless login). The config file I posted in my question worked for me.

  4. Must have a valid known host key, and there turns out to be a bug in Dolphin related to this as well as a simple work-around. The solution I used comes from this blog:

https://yuenhoe.com/blog/2011/06/the-host-key-for-this-server-was-not-found-but-another-type-of-key-exists-when-using-sftp-with-dolphinkio/

“The host key for this server was not found, but another type of key exists.” When using sftp with dolphin/KIO

By Jason "moofang"

On June 29, 2011

In Howto's, KDE, Linux

I’m halfway through my Cosfest X.1 event post, but I bumped into yet another funny issue while working today, so I’m gonna do another quick solve-it post here. If you ever had the following error message shown to you when attempting to access an sftp location via dolphin or KIO in general:

“The host key for this server was not found, but another type of key exists. An attacker might change the default server key to confuse your client into thinking the key does not exist. Please contact your system administrator.”

This might be for you. In particular if you have successfully ssh-ed into the target host before. Following the discussion here, it appears that the problem, in summary, is KIO not being able to recognize a particular (new?) format of specifying a host in the ssh known_hosts list (a bug which has been filed here). Fortunately there is a workaround – since KIO is unable to recognize the known_hosts entry that ssh produces, we simply need to get KIO to be the one to produce the entry.

Back up your ~/.ssh/known_hosts file, then open it with your favorite text editor. Find and remove the entries associated with the host you’re trying to sftp into. If you cannot find it you can just delete everything in the file – with the side effect that you will be prompted again to add the keys back the next time you ssh into a previously known location. When you’re done, open dolphin and attempt to sftp into your desired target location. It should prompt you to add the host’s key – just tell it yes and you should be able to log in successfully.

That’s it! From then on you should be able to direct ssh or sftp-via-KIO into the location whenever you want.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .