Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support authentication with none password #7322

Closed
cyberduck opened this issue Jun 25, 2013 · 10 comments
Closed

Support authentication with none password #7322

cyberduck opened this issue Jun 25, 2013 · 10 comments
Assignees
Labels
enhancement fixed sftp SFTP Protocol Implementation
Milestone

Comments

@cyberduck
Copy link
Collaborator

61fc57f created the issue

A sample code with file list support :

import java.util.ArrayList;
import java.util.List;

import org.apache.sshd.SshServer;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.UserAuth;
import org.apache.sshd.server.auth.UserAuthNone;
import org.apache.sshd.server.command.ScpCommandFactory;
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
import org.apache.sshd.server.sftp.SftpSubsystem;

public class SFTP {

    public static void main(final String[] args) throws Exception {
        SshServer sshd = SshServer.setUpDefaultServer();
        sshd.setPort(1111);
        sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("hostkey.ser"));

        List<NamedFactory<UserAuth>> userAuthFactories = new ArrayList<NamedFactory<UserAuth>>();
        userAuthFactories.add(new UserAuthNone.Factory());
        sshd.setUserAuthFactories(userAuthFactories);

        sshd.setCommandFactory(new ScpCommandFactory());

        List<NamedFactory<Command>> namedFactoryList = new ArrayList<NamedFactory<Command>>();
        namedFactoryList.add(new SftpSubsystem.Factory());
        sshd.setSubsystemFactories(namedFactoryList);

        sshd.start();
    }

}

FileZilla & Nautilus can list files but not Cyberduck.
I get an authentification fail message on Cyberduck whereas server log say authentification is successful.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Please post the transcript from the log drawer (⌘-L).

@cyberduck
Copy link
Collaborator Author

61fc57f commented

Hello,
I have no log in the log drawer.

I first get message :
Discordance de clé dhôte: {0}
La clé dhôte fournie est {0}.

Which is a minor bug too because {0} is not evaluated.

Then I click on "Permettre" and Cyberduck ask me a user and password (not needed with server conf), so I use a random user name and click on "Connexion" : the connection dialog reopen.

@cyberduck
Copy link
Collaborator Author

61fc57f commented

Server side log :

17:14:33.763 [main] INFO  o.a.sshd.common.util.SecurityUtils - BouncyCastle not registered, using the default JCE provider
17:14:49.580 [NioProcessor-2] INFO  o.a.s.server.session.ServerSession - Session created from /127.0.0.1:3539
17:14:49.593 [NioProcessor-2] INFO  o.a.s.s.k.SimpleGeneratorHostKeyProvider - Generating host key...
17:14:49.621 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Client version string: SSH-2.0-Cyberduck/4.3.1 (Mac OS X/10.6.8) (i386)
17:14:49.621 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_KEXINIT
17:14:49.622 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_KEXINIT
17:14:49.655 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_KEXDH_INIT
17:14:49.656 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG1 - Received SSH_MSG_KEXDH_INIT
17:14:49.666 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG1 - K_S:  00 00 00 07 73 73 68 2d 64 73 73 00 00 00 81 00 fd 7f 53 81 1d 75 12 29 52 df 4a 9c 2e ec e4 e7 f6 11 b7 52 3c ef 44 00 c3 1e 3f 80 b6 51 26 69 45 5d 40 22 51 fb 59 3d 8d 58 fa bf c5 f5 ba 30 f6 cb 9b 55 6c d7 81 3b 80 1d 34 6f f2 66 60 b7 6b 99 50 a5 a4 9f 9f e8 04 7b 10 22 c2 4f bb a9 d7 fe b7 c6 1b f8 3b 57 e7 c6 a8 a6 15 0f 04 fb 83 f6 d3 c5 1e c3 02 35 54 13 5a 16 91 32 f6 75 f3 ae 2b 61 d7 2a ef f2 22 03 19 9d d1 48 01 c7 00 00 00 15 00 97 60 50 8f 15 23 0b cc b2 92 b9 82 a2 eb 84 0b f0 58 1c f5 00 00 00 81 00 f7 e1 a0 85 d6 9b 3d de cb bc ab 5c 36 b8 57 b9 79 94 af bb fa 3a ea 82 f9 57 4c 0b 3d 07 82 67 51 59 57 8e ba d4 59 4f e6 71 07 10 81 80 b4 49 16 71 23 e8 4c 28 16 13 b7 cf 09 32 8c c8 a6 e1 3c 16 7a 8b 54 7c 8d 28 e0 a3 ae 1e 2b b3 a6 75 91 6e a3 7f 0b fa 21 35 62 f1 fb 62 7a 01 24 3b cc a4 f1 be a8 51 90 89 a8 83 df e1 5a e5 9f 06 92 8b 66 5e 80 7b 55 25 64 01 4c 3b fe cf 49 2a 00 00 00 81 00 d0 af 9c 6f c4 78 7c b4 20 96 17 a6 1b ef 49 31 42 5d 72 e3 8f 01 ea 82 89 5d af 0b fa 38 28 53 a1 ec f5 cb 1a 3f 0b f6 dc ff 18 e6 7e db 0e e2 0b a7 95 1e a8 1b 2e e4 1c dc 5c 69 a9 eb 37 92 d6 40 c6 0f aa ee 3e 0a 33 ec 21 9e 25 b7 54 5a 0e 44 10 f1 75 af be 81 56 19 e6 85 27 11 7b 0d 04 a1 6b ae 26 af fe 5e 36 26 c6 6b eb c0 e8 b9 af bc 46 8a 75 5e dc ff fd 23 99 51 28 ab 89 02
17:14:49.666 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG1 - f:    00 b4 29 d9 ea 94 73 6f 62 91 62 2f 94 91 47 54 3c 99 7c 28 a6 97 26 30 e5 b1 40 6f 7d e7 21 53 6d fc 1e 59 8b 65 69 5b 44 03 45 b0 b2 75 8c 5d c9 61 01 65 de 7c e3 40 f9 85 64 f1 a6 bb e2 0b a5 e1 61 01 ed 70 47 fe 72 86 81 97 41 b4 73 4c 01 1e a7 42 36 99 83 fc 2e a5 d7 c5 2f 12 20 31 9f 07 10 ce e0 bc ea c4 f5 13 d3 b3 74 5f 29 d9 d7 b6 41 c7 eb 38 19 66 30 ab 7d 1a bb fb 7d a6 26
17:14:49.666 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG1 - sigH: 00 00 00 07 73 73 68 2d 64 73 73 00 00 00 28 01 20 f8 f0 71 01 b6 b9 31 9b 0a fa ed f6 71 62 32 41 5a 13 3f dd fd e3 9e 8f 42 c4 f2 77 e9 5f 24 fe d6 5c e0 7b 15 22
17:14:49.666 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG1 - Send SSH_MSG_KEXDH_REPLY
17:14:49.666 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Send SSH_MSG_NEWKEYS

# here I accept the key issue and click on connect

17:14:59.772 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_NEWKEYS
17:14:59.772 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_NEWKEYS
17:14:59.876 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_SERVICE_REQUEST
17:14:59.876 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_SERVICE_REQUEST 'ssh-userauth'
17:14:59.876 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Accepting user authentication request
17:14:59.876 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Authorized authentication methods: none
17:14:59.877 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_USERAUTH_REQUEST
17:14:59.877 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_USERAUTH_REQUEST
17:14:59.877 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Authenticating user 'po' with method 'none'
17:14:59.878 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Authentication succeeded
17:14:59.878 [NioProcessor-2] INFO  o.a.s.server.session.ServerSession - Session po@/127.0.0.1:3539 authenticated

# next clicks on connect produces no log on server side

# after clicking on cancel

17:20:50.455 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Closing session
17:20:50.455 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Closing IoSession
17:20:50.456 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - IoSession closed
17:20:50.456 [NioProcessor-2] INFO  o.a.s.server.session.ServerSession - Session po@/127.0.0.1:3539 closed

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:2 gael.lalire]:

Hello,
I have no log in the log drawer.

I first get message :
Discordance de clé dhôte: {0}
La clé dhôte fournie est {0}.

Which is a minor bug too because {0} is not evaluated.

Duplicate for #7288.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

In 3e9b6ff.

@cyberduck
Copy link
Collaborator Author

61fc57f commented

Hi, I download a snapshot version (13184) to check and the session creation still fail for Cyberduck.
At the first try it communicates with server

00:05:19.914 [NioProcessor-2] INFO  o.a.s.server.session.ServerSession - Session created from /127.0.0.1:56695
00:05:19.981 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Client version string: SSH-2.0-Cyberduck/4.4 (Mac OS X/10.6.8) (x86_64)
00:05:20.003 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_KEXINIT
00:05:20.004 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_KEXINIT
00:05:20.079 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_KEXDH_INIT
00:05:20.079 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG14 - Received SSH_MSG_KEXDH_INIT
00:05:20.202 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG14 - K_S:  00 00 00 07 73 73 68 2d 64 73 73 00 00 00 81 00 ee e2 1f 91 ca 22 4f 85 ee c5 4d 44 df 29 cc 56 60 50 b6 86 d6 be f6 ac 65 a2 71 70 23 a3 67 48 de 46 64 7c 8e d7 46 02 b4 12 fb 5d e1 20 16 51 96 7e 21 f7 22 5e 81 90 d8 92 94 c3 7f 68 02 7e 72 59 3e f1 92 03 a9 9e 57 8e 3a 3b 8a 40 24 05 d7 90 f1 5d 78 08 6f d1 96 bc 47 50 1c e3 f7 21 e8 10 f9 d1 b6 99 32 01 8e 85 8b 37 3f 0c 42 3a 3a c6 bc e9 09 33 ef 71 ea 69 40 ae e0 7e 68 35 00 00 00 15 00 e7 82 01 80 2f fc e7 f4 c7 08 84 53 06 fd bd 5c ed c7 ea 7b 00 00 00 80 3f 94 af 1c 43 84 7c c8 7c 2f 7f 8f 54 77 65 4c c6 ae d2 72 1c 30 51 05 c5 36 a7 65 a4 93 3d 3c d8 be 12 50 62 87 85 c7 52 e3 d2 c4 b7 09 26 e2 88 e7 2f 10 ba ec 4d 9e d5 ba e2 a1 9e 57 99 d6 8e 9d 44 e5 b2 3a 5f dd c4 fc fb 27 f4 5e 52 83 0b 0a bb a6 9b 40 60 76 7f 38 49 1f ed 93 0e 07 fc a1 e7 f9 20 7b 7d f3 d3 d0 79 87 d1 bb f6 3a 75 88 c6 26 e2 7b cb 36 0a 3c 8d ae 34 24 b3 73 00 00 00 81 00 db ea a2 3c 6f d9 26 be e8 34 18 82 0e 91 36 6e e9 e4 66 cb 3a 72 bf 21 27 1e e0 5a 96 4a ff 2a 86 f3 61 54 67 8b 9f 37 4e c9 b1 4c a0 70 66 a1 08 4f 40 93 cf f7 5d e4 7f 62 25 89 07 81 57 5d ee 55 00 23 f3 f0 57 ac e2 26 05 4a ef 7c 95 8e 4d 6a da fe 2d 0b 46 eb 82 bf bb 34 44 2b ee 91 2d 2a 52 f7 1e a0 c1 ac a1 15 a8 f7 b4 80 3a fd 84 5f 3a ec 08 8a 54 bc bb 51 3a 40 9a ac 20 dc
00:05:20.202 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG14 - f:    00 a8 2c 59 45 f2 f2 38 c1 9a 28 a0 0f f1 90 0f 17 22 ed 12 f0 ae 02 e9 4c a2 e2 6a b9 89 4c 92 9a c5 99 c3 7f 10 22 b6 59 f9 da ec 25 df ac 67 63 ba 1f 82 2b cc c8 5e 4a f5 60 f9 e5 48 05 d8 15 1d 5e c0 f5 31 91 0e 4d b8 2c 92 bb f2 50 fe b3 92 f7 bd 6c cc 6d ae 2e 7a b3 58 b8 16 16 a5 8a 57 94 e7 f6 14 20 ea bd 43 81 66 4b eb 06 ea 2c 80 6a b3 27 16 6a 74 51 81 56 68 4e a0 1c d6 1d c7 cb 1f 59 3d 05 74 60 42 d5 f9 72 12 de 8c 02 a2 df 22 cc 03 56 26 5e 1e eb c3 37 0f fd e3 07 33 45 ac 87 88 88 ac 12 ff 20 22 e2 17 af f0 e1 12 10 89 6e b4 9e 1c 43 b8 56 e5 4b b8 e9 ac 7e 89 34 ea a6 57 f2 cb 11 0b e0 3f 1c 6b 6f d6 c1 bd 5b c5 5f 81 25 7d 33 ae ed 03 76 8e a5 5c a8 04 e5 0b 87 a3 b9 d7 1b 9e 1c 8c 51 98 55 03 aa ac 7d 3b 62 9d a0 55 4e 68 20 77 bf 01 11 c6 16
00:05:20.202 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG14 - sigH: 00 00 00 07 73 73 68 2d 64 73 73 00 00 00 28 64 e1 bf 6f 1d 44 9b 4b 03 61 be 37 61 57 17 6d fd ab b3 c8 35 d4 10 ce c8 a3 75 82 65 1a f5 f9 1f b7 f6 1f 86 35 04 c5
00:05:20.202 [NioProcessor-2] DEBUG org.apache.sshd.server.kex.DHG14 - Send SSH_MSG_KEXDH_REPLY
00:05:20.203 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Send SSH_MSG_NEWKEYS
00:05:20.254 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_NEWKEYS
00:05:20.254 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_NEWKEYS
00:05:20.300 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_SERVICE_REQUEST
00:05:20.301 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_SERVICE_REQUEST 'ssh-userauth'
00:05:20.301 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Accepting user authentication request
00:05:20.302 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Authorized authentication methods: none
00:05:20.303 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received packet SSH_MSG_USERAUTH_REQUEST
00:05:20.304 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Received SSH_MSG_USERAUTH_REQUEST
00:05:20.304 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Authenticating user 'admin' with method 'none'
00:05:20.305 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Authentication succeeded
00:05:20.306 [NioProcessor-2] INFO  o.a.s.server.session.ServerSession - Session admin@/127.0.0.1:56695 authenticated

but it is redirecting on login fail window (maybe an issue with validate ?).

Each try to connect produce nothing and a cancel close the server session :

00:14:02.720 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Closing session
00:14:02.722 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - Closing IoSession
00:14:02.723 [NioProcessor-2] DEBUG o.a.s.server.session.ServerSession - IoSession closed
00:14:02.723 [NioProcessor-2] INFO  o.a.s.server.session.ServerSession - Session admin@/127.0.0.1:56695 closed

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Reworked fix in 4073e01. Check Anonymous login in the bookmark of login prompt.

@cyberduck
Copy link
Collaborator Author

61fc57f commented

Hello, I got file listing with sample example.
However this is because server provides 'none' authentication method, when testing with 'publickey' it does not work.
In addition checking the private key should disable password box, the public key authentication is user scoped.

Should I open a new bug for publickey authentication ?

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:9 gael.lalire]:

Hello, I got file listing with sample example.
However this is because server provides 'none' authentication method

So this issue is fixed?

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:9 gael.lalire]:

when testing with 'publickey' it does not work.
In addition checking the private key should disable password box, the public key authentication is user scoped.

The password is to decrypt the private key if it is encrypted.

Should I open a new bug for publickey authentication ?

Yes, please file new bugs.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement fixed sftp SFTP Protocol Implementation
Projects
None yet
Development

No branches or pull requests

2 participants