Bug 237162 - SFTP keeps asking for passphrase for key
Summary: SFTP keeps asking for passphrase for key
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: sftp (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Andreas Schneider
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-10 22:16 UTC by Jeffrey
Modified: 2026-01-14 23:45 UTC (History)
3 users (show)

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


Attachments
SFTP debug log (205.76 KB, text/plain)
2010-06-08 21:52 UTC, Jeffrey
Details
KIO sftp log (412.40 KB, text/plain)
2010-09-07 16:30 UTC, Jeffrey
Details
SFTP log with Konqueror (242.80 KB, text/plain)
2010-09-07 18:00 UTC, Jeffrey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey 2010-05-10 22:16:37 UTC
Version:           unknown (using 4.4.3 (KDE 4.4.3), Debian packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.32-5-686

Reported here per https://bugs.kde.org/show_bug.cgi?id=236470

KIO wasn't using system-set SSH keys (rsa and dsa) when set in /etc/ssh/ssh_config.  Copying that file to local ~/.ssh/config then allows it to prompt for passphrase, but it asks for that passphrase with every directory change on the remote host.

Thanks for KDE!
Comment 1 Andreas Schneider 2010-05-11 10:00:54 UTC
I've implemented parsing of /etc/ssh/ssh_config now.

The problem here is that we use the password dialog for the ssh key too. The password dialog is for Username/Password. We have to find a way to define it for passphrase only.
Comment 2 Andreas Schneider 2010-05-11 10:01:14 UTC
As a workaround, use ssh-agent.
Comment 3 Andreas Schneider 2010-06-04 09:21:27 UTC
This should be fixed with libssh 0.4.4. Can you confirm this?
Comment 4 Jeffrey 2010-06-04 17:48:33 UTC
It is now working, I don't know if it is the newer libssh (Debian package: libssh-4, Version: 0.4.4-1) or if its the KDE 4.4.4, but this is now working in Debian Sid.

Thanks a lot, this can be closed!
Comment 5 Jeffrey 2010-06-08 18:07:27 UTC
I may have not tested this enough; SFTP (KIO slave) is still prompting for SSH-key passphrase on every folder change.
Comment 6 Andreas Schneider 2010-06-08 21:11:41 UTC
Could you please provide your ssh config file and logs and describe how to reproduce it?

http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_IOSlaves/Debugging_kio_sftp
Comment 7 Jeffrey 2010-06-08 21:50:59 UTC
> Could you please provide your ssh config file
> and logs and describe how to reproduce it?

To reproduce this, use an SSH key to connect as root on a host and browse various folders; the prompt for the passphrase pops up with every folder change.


I've not had an ssh-config file until this started happening; here is that file:
====
shell$ cat .ssh/config
Host *
   ForwardX11 yes
   IdentityFile ~/.ssh/id_rsa
   IdentityFile ~/.ssh/dsa.home
   IdentityFile ~/.ssh/id_dsa
   IdentityFile ~/.ssh/id_rsa_SECURE
   IdentityFile ~/.ssh/rsnapshot
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no
# http://ubuntu.wordpress.com/2006/02/03/keeping-ssh-sessions-alive/
ServerAliveInterval 45
====

Before this was happening I was just using the system-wide config file, /etc/ssh/ssh_config, which is exactly the same as above except with comments all over it.

I set my SSHD to debug but I don't know how the daemon's logging affects the client-side.  The SFTP_KIO debug log is coming after I post this comment.
Comment 8 Jeffrey 2010-06-08 21:52:24 UTC
Created attachment 47819 [details]
SFTP debug log

This is the debug log as created by KDebugDialog per the linked instructions.
Comment 9 Andreas Schneider 2010-07-21 17:02:12 UTC
I can't reproduce this here with KDE 4.4.5 and libssh 0.4.5. Do you still encounter this problem?
Comment 10 Jeffrey 2010-09-05 22:13:47 UTC
Sorry, yes I still have this issue on 4.4.5 on Debian

On Sep 5, 2010 10:29 AM, "Andreas Schneider" <asn@cynapses.org> wrote:

https://bugs.kde.org/show_bug.cgi?id=237162
Andreas Schneider <asn@cynapses.org> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
            Status|REOPENED                    |RESOLVED
        Resolution|                            |FIXED

-- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email -------
You are receiving th...
Comment 11 Andreas Schneider 2010-09-05 22:35:49 UTC
Which version of libssh are you using?
Comment 12 Jeffrey 2010-09-07 16:00:08 UTC
I hope that these are what you need (below); if not, let me know!

As an aside, is there any config file which I could delete to 'reset' this behaviour, without losing my shortcuts listed along the left side of Dolphin and other KDE File Open/Safe dialogues?

> Which version of libssh are you using?

#jthomas@jthomas:08:52:~$ aptitude show libssh2-1
Package: libssh2-1                       
State: installed
Automatically installed: yes
Version: 1.2.6-1
Priority: optional
Section: libs
Maintainer: Mikhail Gusarov <dottedmag@debian.org>
Uncompressed Size: 209k
Depends: libc6 (>= 2.3), libgcrypt11 (>= 1.4.2), zlib1g (>= 1:1.1.4)
Description: SSH2 client-side library
 libssh2 is a client-side C library implementing the SSH2 protocol. It supports regular terminal, SCP and SFTP sessions; port forwarding; password, key-based and keyboard-interactive authentication. 
 
 This package contains the runtime library.

#
#jthomas@jthomas:08:57:~$ aptitude show libssh-4
Package: libssh-4                        
New: yes
State: installed
Automatically installed: yes
Version: 0.4.5-1
Priority: optional
Section: libs
Maintainer: Laurent Bigonville <bigon@debian.org>
Uncompressed Size: 299k
Depends: libc6 (>= 2.4), libssl0.9.8 (>= 0.9.8m-1), zlib1g (>= 1:1.1.4)
Description: A tiny C SSH library
 The ssh library was designed to be used by programmers needing a working SSH implementation by the mean of a library. The complete control of the client is made by the programmer. With libssh, you can remotely
 execute programs, transfer files, use a secure and transparent tunnel for your remote programs. With its SFTP implementation, you can play with remote files easily.
Homepage: http://www.libssh.org/
Comment 13 Andreas Schneider 2010-09-07 16:05:43 UTC
Could you please provide logs?

http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_IOSlaves/Debugging_kio_sftp
Comment 14 Jeffrey 2010-09-07 16:30:33 UTC
Created attachment 51393 [details]
KIO sftp log

> Could you please provide logs?

Attached.  Please note that for security reasons I've removed the actual name of my company's server, which in this case is RHEL 5.5, but this issue happens with Debian servers as well.

There is also an older log attached to this report, just fyi.
Comment 15 Andreas Schneider 2010-09-07 16:42:40 UTC
Can you reproduce the problem with konqueror too?
Comment 16 Jeffrey 2010-09-07 17:22:11 UTC
> Can you reproduce the problem with konqueror too?

Yes, it has the same behaviour.
Comment 17 Andreas Schneider 2010-09-07 17:40:06 UTC
Could you please create a new log with konqueror?
Comment 18 Jeffrey 2010-09-07 18:00:58 UTC
Created attachment 51396 [details]
SFTP log with Konqueror

This is SFTP from the same local machine to the same remote host as the last attachment, this time using Konqueror

Please note that in this case, and also with Dolphin, sometimes I am prompted for the passphrase 'out of sync' with what I am actually doing:
1.  log in with SFTP and get the prompt
2.  Dir lists in Konqueror and I get the prompt again
3.  Click to CD to etc/ and after the list comes into Konqueror, I get prompted again

Note this also happens in Dolphin, but not always, but the prompting isn't ALWAYS before showing me what is there, which would make more sense to me if it were...
Comment 19 Andreas Schneider 2010-09-09 00:06:17 UTC
This is really strange. According to the log for each directory change a new kio slave is started. This shouldn't be the case and it is the reason why you get asked for a new password on each directory change.

Are you sure that your KDE installation is correct?

I'm not able to reproduce this on my Fedora and openSUSE installations.
Comment 20 Jeffrey 2010-09-09 15:42:38 UTC
> Are you sure that your KDE installation is correct?

I suppose that I am not positive, but its from Debian and I would bet that the installation is rather accurate.  Perhaps something in my .kde/ is incorrect, are there any files which I can delete to have this restore to the default behaviour?
Comment 21 km 2010-12-18 22:05:46 UTC
I have the same issue on Opensuse (KDE 4.5.4, but it was also present in earlier wersions). 

Possibly related:
https://bugs.kde.org/show_bug.cgi?id=255991 
https://bugs.kde.org/show_bug.cgi?id=209764
Comment 22 Andreas Schneider 2011-04-06 13:33:29 UTC
Could you please try KDE 4.6.2 and report back?
Comment 23 Jeffrey 2011-04-06 14:21:32 UTC
> Could you please try KDE 4.6.2 and report back?
I just got onto 4.6.1 with Debian Sid; when 4.6.2 comes down I will do so; sorry, this will be a bit of time before I get to 4.6.2.  Thanks for the work on this.
Comment 24 Andreas Schneider 2011-08-25 20:52:06 UTC
This should have been fixed. Can you confirm this?
Comment 25 Andreas Schneider 2014-01-09 09:36:37 UTC
I've updated the kio sftp salve to use libssh 0.6.0 which has a new API for public key management. As a lot of code has been improved this should be fixed once and for all.
Comment 26 postix 2026-01-14 23:38:13 UTC
I'd like to re-open it. Dolphin often keeps nagging to enter the SSH password, though I can browse the remote SFTP folders just fine.

In the log I see
kioworker[19530]: Socket not connected QLocalSocket::PeerClosedError
kioworker[19530]: An error occurred during write. The worker terminates now.
kiod6[19326]: QWindow::fromWinId(): platform plugin does not support foreign windows.
whenever this happens.



Operating System: Fedora Linux 43
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.18.5-200.fc43.x86_64 (64-bit)
libssh 0.11.3
Comment 27 postix 2026-01-14 23:42:10 UTC
I read 2024 instead of 2014. I will open a new report. :)