Bug 278986 - sftp doesn't work in dolphin - authentication failed and no login dialog
Summary: sftp doesn't work in dolphin - authentication failed and no login dialog
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: sftp (show other bugs)
Version: SVN
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Andreas Schneider
URL:
Keywords:
: 280253 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-01 02:05 UTC by aditsu
Modified: 2015-08-06 12:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.2


Attachments
kio_sftp log (6.24 KB, text/plain)
2011-08-01 07:31 UTC, aditsu
Details
kio_sftp + libssh log (10.64 KB, text/plain)
2011-08-01 17:28 UTC, aditsu
Details
sshd log (7.49 KB, text/plain)
2011-08-01 17:36 UTC, aditsu
Details
kio_sftp log with username specified (12.49 KB, text/plain)
2011-08-01 21:37 UTC, aditsu
Details
new kio_sftp log (5.66 KB, text/plain)
2011-09-02 06:41 UTC, aditsu
Details
kio_sftp log after 2nd patch (8.13 KB, text/plain)
2011-09-05 17:24 UTC, aditsu
Details
log with verbosity=3 (47.06 KB, text/plain)
2011-09-05 19:50 UTC, aditsu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aditsu 2011-08-01 02:05:41 UTC
Version:           1.7 (using KDE 4.7.0) 
OS:                Linux

When I try to access an sftp url in dolphin, it shows "authentication failed" at the bottom and "loading folder..." at the bottom right, with a kind of progress bar that goes back and forth forever. There is no login dialog, and it doesn't do anything.

Reproducible: Always

Steps to Reproduce:
Try going to sftp://some_server


Expected Results:  
Login dialog if not already logged in; listing the files afterwards
Comment 1 Andreas Schneider 2011-08-01 07:06:36 UTC
Thanks for taking the time to report a bug. I'm not able to reproduce the bug you're describing. Everything works just fine here. Please provide log files, see:

http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_IOSlaves/Debugging_kio_sftp
Comment 2 aditsu 2011-08-01 07:31:46 UTC
Created attachment 62409 [details]
kio_sftp log

I enabled logging for kio_sftp as instructed there and got some log output. Let me know if you need more information.
Comment 3 Andreas Schneider 2011-08-01 12:40:34 UTC
To what kind of server are you trying to connect. It looks like the authentication has been canceled by the server.
Comment 4 aditsu 2011-08-01 13:29:09 UTC
It's my Linux laptop, to which I previously connected hundreds of times. ssh and sftp from the command line work with no problems, and sftp in dolphin worked well in kde 4.6.3 from what I remember. Also, now sftp in dolphin fails in the same way with any server, not just with this one.
Comment 5 Andreas Schneider 2011-08-01 14:06:59 UTC
I think this is missing ECDSA host key support in libssh:

https://red.libssh.org/issues/29
Comment 6 aditsu 2011-08-01 14:34:14 UTC
Hm.. that's possible. That bug report refers to kde bug 270322 and it is mentioned there that the necessary code has been added to libssh and will be available in libssh 0.6. Since the latest available libssh version seems to be 0.5.0, I guess I'll have to try the latest code from their repository.
Comment 7 aditsu 2011-08-01 16:55:33 UTC
Well, I think it's not that. I installed the latest libssh from git and restarted the computer, the problem remains the same. Besides, I checked in known_hosts and "sente" is listed with "ssh-rsa".
What about the error canonicalizing the "." path?
Comment 8 Andreas Schneider 2011-08-01 17:14:01 UTC
I dunno what the error is without a libssh or server log. It is described in the debug howto how to enable it.
Comment 9 aditsu 2011-08-01 17:25:03 UTC
Sure, I said let me know if you need more information. I'll post the log with libssh info in a minute.
Comment 10 aditsu 2011-08-01 17:28:07 UTC
Created attachment 62433 [details]
kio_sftp + libssh log

Log with libssh (latest git) debug information.
I'll see if I can get something on the server too.
Comment 11 aditsu 2011-08-01 17:31:53 UTC
Oh, I ran "KIO_SFTP_LOG_VERBOSITY=1 kdeinit4" in konsole, and I noticed that later printed out this stuff while sftp failed:

kioslave: ####### CRASH ###### protocol = kio_sftp pid = 21996 signal = 11
[1] Reading configuration data from /etc/ssh/ssh_config
[1] Reading configuration data from /etc/ssh/ssh_config
kio_sftp(21997)/kio (kioslave) KIO::SlaveBase::error: error() called twice! Please fix the KIO slave. 
[1] Reading configuration data from /etc/ssh/ssh_config
kioslave: ####### CRASH ###### protocol = kio_sftp pid = 21998 signal = 11
kio_sftp(21997)/kio (kioslave) KIO::SlaveBase::error: error() called twice! Please fix the KIO slave. 
[1] Reading configuration data from /etc/ssh/ssh_config
kio_sftp(21997)/kio (kioslave) KIO::SlaveBase::error: error() called twice! Please fix the KIO slave.
Comment 12 aditsu 2011-08-01 17:36:32 UTC
Created attachment 62434 [details]
sshd log

And here is the debug log from the ssh server.
Comment 13 Andreas Schneider 2011-08-01 18:01:14 UTC
Ouch, this is bad. Do you know how to use gdb an get a backtrace? How to attach gdb is described here:

http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_IOSlaves
Comment 14 aditsu 2011-08-01 19:05:47 UTC
I'm familiar with GUI debuggers but not much with gdb. Mainly, I don't know where and how to stop the process to get the backtrace.
This is what I got so far:

#0  0x00007faed568e663 in select () from /lib64/libc.so.6
#1  0x00007faed6ca54ee in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007faed4a53088 in ?? () from /usr/lib64/qt4/libQtNetwork.so.4
#3  0x00007faed4a3a326 in ?? () from /usr/lib64/qt4/libQtNetwork.so.4
#4  0x00007faed4a4ad80 in QAbstractSocket::waitForReadyRead(int) () from /usr/lib64/qt4/libQtNetwork.so.4
#5  0x00007faecab7557a in ?? () from /usr/lib64/libkio.so.5
#6  0x00007faecac53149 in KIO::SlaveBase::dispatchLoop() () from /usr/lib64/libkio.so.5
#7  0x00007faec0871ee1 in kdemain () from /usr/lib64/kde4/kio_sftp.so
#8  0x0000000000407fd3 in _start ()
Comment 15 Andreas Schneider 2011-08-01 20:39:59 UTC
The username redirection is strange. I've might fixed but I'm not sure. Do you have a config file for this server?
Comment 16 aditsu 2011-08-01 20:52:18 UTC
What config file? You mean for sshd? Here are all the lines that don't start with a #:

PermitRootLogin no
PasswordAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
PrintLastLog no
Subsystem       sftp    /usr/lib64/misc/sftp-server

openssh version is 5.8_p1-r1
Comment 17 Andreas Schneider 2011-08-01 21:03:07 UTC
Does it work if you specify a username? sftp://user@host
Comment 18 aditsu 2011-08-01 21:37:25 UTC
Created attachment 62445 [details]
kio_sftp log with username specified

This way I get a login dialog, but then the password doesn't work (and yes I'm 100% sure I typed the correct password). On the server I can see some "authentication failure" messages.
Comment 19 aditsu 2011-08-01 21:41:20 UTC
Oh, btw, I see that sftp://user:password@host works, but I shouldn't have to do that.
Comment 20 Clovis Gladstone 2011-08-05 16:19:01 UTC
I just wanted to confirm that I'm having the exact same problem, and the only way to resolve it is to add the user and password as mentioned just above. Always worked before KDE 4.7.
Comment 21 Andreas Schneider 2011-08-05 16:25:10 UTC
I've submitted a first patch and working on the correct fix.
Comment 22 H.H. 2011-08-11 14:20:26 UTC
I have the same problem, since update to kde-4.7 sftp does not work anymore. here is my log output:


kio_sftp(5264) sftpProtocol::listDir: list directory:  KUrl("sftp://root@myserver.com")
kio_sftp(5264) sftpProtocol::openConnection: username= "root" , host= "myserver.com" , port= 22
kio_sftp(5264) sftpProtocol::openConnection: checking cache: info.username =  "root" , info.url =  "sftp://root@myserver.com:22"
kio_sftp(5264) sftpProtocol::openConnection: Creating the SSH session and setting options
Reading configuration data from /home/me/.ssh//config
Reading configuration data from /etc/ssh/ssh_config
[1] Unsupported option: ForwardX11Trusted, line: 32

[1] Unsupported option: SendEnv, line: 67

[1] Unsupported option: SendEnv, line: 68

[1] Unsupported option: SendEnv, line: 69

[1] Unsupported option: VisualHostKey, line: 73

[1] Unsupported option: HashKnownHosts, line: 77

kio_sftp(5264) sftpProtocol::openConnection: Trying to connect to the SSH server
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  Trying to connect to host: myserver.com:22 with timeout 30000 ms
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  SSH server banner: SSH-1.99-OpenSSH_4.4
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  Analyzing banner: SSH-1.99-OpenSSH_4.4
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  We are talking to an OpenSSH client version: 4.4 (40400)
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  SSH_MSG_NEWKEYS sent
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  Got SSH_MSG_NEWKEYS
kio_sftp(5264) sftpProtocol::openConnection: Getting the SSH server hash
kio_sftp(5264) sftpProtocol::openConnection: Checking if the SSH server is known
kio_sftp(5264) sftpProtocol::openConnection: Trying to authenticate with the server
kio_sftp(5264) sftpProtocol::openConnection: Trying to authenticate public key
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  Trying to authenticate with SSH agent keys as user: root
kio_sftp(5264) sftpProtocol::openConnection: Trying to authenticate with keyboard interactive
kio_sftp(5264) sftpProtocol::authenticateKeyboardInteractive: Entering keyboard interactive function
kio_sftp(5264) sftpProtocol::authenticateKeyboardInteractive: name= ""  instruction= ""  prompts 1
kio_sftp(5264) sftpProtocol::authenticateKeyboardInteractive: prompt= "Password: "  echo= "0"
kio_sftp(5264) sftpProtocol::openConnection: Trying to authenticate public key
kio_sftp(5264) sftpProtocol::log_callback: [ 1 ]  Trying to authenticate with SSH agent keys as user: root
kio_sftp(5264) sftpProtocol::openConnection: Trying to authenticate with keyboard interactive
kio_sftp(5264) sftpProtocol::authenticateKeyboardInteractive: Entering keyboard interactive function
kio_sftp(5264) sftpProtocol::authenticateKeyboardInteractive: name= ""  instruction= ""  prompts 1
kio_sftp(5264) sftpProtocol::authenticateKeyboardInteractive: prompt= "Password: "  echo= "0"
kio_sftp(5264) sftpProtocol::openConnection: First attempt failed! Re-prompting user
kio_sftp(5264) sftpProtocol::openConnection: User canceled, dlgResult =  false
kio_sftp(5264) sftpProtocol::closeConnection: closeConnection()
kio_sftp(5264) sftpProtocol::requiresUserNameRedirection: Connected ? false Original: "root" Current: "root"
kio_sftp(5264) sftpProtocol::canonicalizePath: Path to canonicalize:  "."
kio_sftp(5264) sftpProtocol::canonicalizePath: Could not canonicalize path:  "."
kio_sftp(5264)/kio (kioslave) KIO::SlaveBase::error: error() called twice! Please fix the KIO slave.
Comment 23 Andreas Schneider 2011-08-11 17:20:17 UTC
This patch should fix it.

http://git.cryptomilk.org/users/asn/kde-runtime.git/commit/?h=kio_sftp_redirect_user
Comment 24 Andreas Schneider 2011-08-17 10:31:58 UTC
*** Bug 280253 has been marked as a duplicate of this bug. ***
Comment 25 Andreas Schneider 2011-08-25 20:49:50 UTC
This has been fixed upstream and backported to KDE 4.7.

See http://commits.kde.org/kde-runtime/23e4ab03091e9d824e78171ea92a2da2326256d8
Comment 26 aditsu 2011-09-02 06:32:21 UTC
Hi again, I'm using kde 4.7.0 with the above kioslaves patch applied, and I'm still having the same problem. I'll see if I can get some debug information.
Comment 27 aditsu 2011-09-02 06:41:37 UTC
Created attachment 63297 [details]
new kio_sftp log

This is the new sftp log with libssh debug output
Comment 28 Andreas Schneider 2011-09-02 07:49:22 UTC
There are two patches needed to get this working correctly. So please test with KDE 4.7.1.
Comment 29 aditsu 2011-09-02 08:38:06 UTC
I can't get 4.7.1 easily right now. If you could point me to the other patch, that would be great. If not, I'll have to wait.
Comment 31 aditsu 2011-09-05 17:24:30 UTC
Created attachment 63410 [details]
kio_sftp log after 2nd patch

Thanks, I applied this patch too, and now I get a login dialog, but it still fails to login.
Comment 32 Andreas Schneider 2011-09-05 17:38:19 UTC
Could you please enable libssh loggin too?

KIO_SFTP_LOG_VERBOSITY=3 kdeinit4
Comment 33 aditsu 2011-09-05 19:50:15 UTC
Created attachment 63415 [details]
log with verbosity=3

I had ssh debug logging before but with verbosity=1
Comment 34 Andreas Schneider 2011-09-06 07:19:32 UTC
Could you try with

KIO_SFTP_LOG_VERBOSITY=2 kdeinit4

too? Looks like something is wrong with logging.
Comment 35 Andreas Schneider 2011-09-06 09:26:42 UTC
Git commit 2a013593828c26d2cab6795f82e99bb5e247649c by Andreas Schneider.
Committed on 06/09/2011 at 11:17.
Pushed by anschneider into branch 'master'.

kio_sftp: Call the password dialog for kbdint too.

BUG: 278986

M  +17   -17   kioslave/sftp/kio_sftp.cpp

http://commits.kde.org/kde-runtime/2a013593828c26d2cab6795f82e99bb5e247649c
Comment 36 Andreas Schneider 2011-09-06 09:26:42 UTC
Git commit f014971cfb172883b6e7e16356a07d20b819dcdd by Andreas Schneider.
Committed on 06/09/2011 at 11:19.
Pushed by anschneider into branch 'master'.

kio_sftp: Set the information we obtained from the dialog.

We never set the password so we always fail.

BUG: 278986

M  +3    -0    kioslave/sftp/kio_sftp.cpp

http://commits.kde.org/kde-runtime/f014971cfb172883b6e7e16356a07d20b819dcdd
Comment 37 Andreas Schneider 2011-09-06 09:26:53 UTC
Git commit c9442bd99a6943f3a0cfd686db71b15aaf279ca0 by Andreas Schneider.
Committed on 06/09/2011 at 11:17.
Pushed by anschneider into branch 'KDE/4.7'.

kio_sftp: Call the password dialog for kbdint too.

BUG: 278986
(cherry picked from commit 2a013593828c26d2cab6795f82e99bb5e247649c)

M  +17   -17   kioslave/sftp/kio_sftp.cpp

http://commits.kde.org/kde-runtime/c9442bd99a6943f3a0cfd686db71b15aaf279ca0
Comment 38 Andreas Schneider 2011-09-06 09:26:53 UTC
Git commit 1e271597de95423d00b2c86cab6176ce2e719732 by Andreas Schneider.
Committed on 06/09/2011 at 11:19.
Pushed by anschneider into branch 'KDE/4.7'.

kio_sftp: Set the information we obtained from the dialog.

We never set the password so we always fail.

BUG: 278986
(cherry picked from commit f014971cfb172883b6e7e16356a07d20b819dcdd)

M  +3    -0    kioslave/sftp/kio_sftp.cpp

http://commits.kde.org/kde-runtime/1e271597de95423d00b2c86cab6176ce2e719732
Comment 39 Andreas Schneider 2011-09-06 09:28:33 UTC
This should fix it.
Comment 40 Andreas Schneider 2011-09-07 11:23:21 UTC
aditsu: Can you confirm this?
Comment 41 aditsu 2011-09-08 12:50:55 UTC
Hi, sorry, I've been quite busy and had some hardware problems too.
I'd like to confirm, but it seems that there are way too many patches to keep track of. And I'm still on 4.7.0.
I wonder if you could provide a single unified diff of the relevant files that were modified between 4.7.0 and current head (or at least since 4.7.1), that would help a lot.
And on the other hand, I wonder why you apparently didn't find the exact same problems while testing.
Comment 42 Marco Martin 2011-09-12 19:42:52 UTC
Git commit 64449a504e6f2e87c52c99d7daf8a2145ad11ab2 by Marco Martin, on behalf of Andreas Schneider.
Committed on 06/09/2011 at 11:17.
Pushed by mart into branch 'active-development/4.7'.

kio_sftp: Call the password dialog for kbdint too.

BUG: 278986
(cherry picked from commit 2a013593828c26d2cab6795f82e99bb5e247649c)

M  +17   -17   kioslave/sftp/kio_sftp.cpp

http://commits.kde.org/kde-runtime/64449a504e6f2e87c52c99d7daf8a2145ad11ab2
Comment 43 Marco Martin 2011-09-12 19:42:52 UTC
Git commit c87240940667d43b72152f9f95e4611dba48c7ca by Marco Martin, on behalf of Andreas Schneider.
Committed on 06/09/2011 at 11:19.
Pushed by mart into branch 'active-development/4.7'.

kio_sftp: Set the information we obtained from the dialog.

We never set the password so we always fail.

BUG: 278986
(cherry picked from commit f014971cfb172883b6e7e16356a07d20b819dcdd)

M  +3    -0    kioslave/sftp/kio_sftp.cpp

http://commits.kde.org/kde-runtime/c87240940667d43b72152f9f95e4611dba48c7ca
Comment 44 aditsu 2011-09-29 22:15:10 UTC
Hi again, I finally managed to test the latest code. I'm running kde 4.7.1 now and I got the latest kio_sftp.cpp from https://projects.kde.org/projects/kde/kde-runtime/repository/changes/kioslave/sftp/kio_sftp.cpp and made a diff against the 4.7.1 version, and reinstalled the kioslaves using this patch.
The result: sftp is now working in dolphin. Thanks!
Comment 45 Andreas Schneider 2011-09-30 07:58:40 UTC
Thanks for testing. 4.7.2 will be released next Tuesday!
Comment 46 EMR_Kde 2015-08-06 12:19:22 UTC
I can sftp://foo.bar.com but it says authentication failed when I try sftp://otheruser@foo.bar.com

Using ssh to go to otheruser@foo.bar.com works fine from command line.

so.... regressed bug? DOLPHIN 15.04.0 / KDE 4.14.9