0 votes
by (180 points)

I'm trying to connect via two-way public-key authentication from a client to Rebex Tiny SFTP Server. I've setup my public key properly and have also set my private key properly. Need assistance below. It seems to be rejecting the pair? I'm not sure.

User public key 'C:\Users\BRITOL\Desktop\SSHKeys\openssh.pub' loaded.
Fingerprint: f3:f5:55:31:ae:62:58:90:7d:83:2a:37:d8:46:83:ff
Public key authentication enabled.
Binding SFTP server to port 22...
Starting...
19:07:15.892 Info Server: Starting server.
19:07:15.893 Info Server: Listening for connections at 0.0.0.0:22.
19:07:15.895 Info Server: Server started.
SFTP server has started and is ready to accept connections.
19:07:19.871 Debug Server: Accepted connection from 10.4.3.27:25999.
19:07:19.874 Info Server: Session 1: Started on connection from 10.4.3.27:25999.
19:07:19.875 Debug SSH: Session 1: Local SSH version: SSH-2.0-RebexSSH_1.0.2.27069
19:07:19.878 Debug SSH: Session 1: Remote SSH version: SSH-2.0-OpenSSH_3.5p1
19:07:19.879 Debug SSH: Session 1: Performing algorithm negotiation and key exchange.
19:07:19.881 Verbose SSH: Session 1: Sent packet SSH_MSG_KEXINIT (808 bytes).
19:07:19.882 Verbose SSH: Session 1: Received packet SSH_MSG_KEXINIT (544 bytes).
19:07:19.884 Debug SSH: Session 1: Performing key exchange using diffie-hellman-group-exchange-sha1 with ssh-rsa.
19:07:19.931 Verbose SSH: Session 1: Received packet SSH_MSG_PACKET34 (24 bytes).
19:07:19.933 Verbose SSH: Session 1: Sent packet SSH_MSG_KEXDH_REPLY (536 bytes).
19:07:19.949 Verbose SSH: Session 1: Received packet SSH_MSG_PACKET32 (272 bytes).
19:07:20.024 Verbose SSH: Session 1: Sent packet SSH_MSG_PACKET33 (832 bytes).
19:07:20.024 Verbose SSH: Session 1: Sent packet SSH_MSG_NEWKEYS (16 bytes).
19:07:20.026 Debug SSH: Session 1: Current encryptor is aes128-cbc/hmac-md5.
19:07:20.043 Verbose SSH: Session 1: Received packet SSH_MSG_NEWKEYS (16 bytes).
19:07:20.045 Debug SSH: Session 1: Current decryptor is aes128-cbc/hmac-md5.
19:07:20.046 Debug SSH: Session 1: Key exchange finished.
19:07:20.093 Verbose SSH: Session 1: Received packet SSH_MSG_SERVICE_REQUEST (48 bytes).
19:07:20.095 Debug SSH: Session 1: Performing authentication.
19:07:20.098 Verbose SSH: Session 1: Sent packet SSH_MSG_SERVICE_ACCEPT (48 bytes).
19:07:20.099 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (64 bytes).
19:07:20.100 Debug SSH: Session 1: Starting authentication as 'tester' for 'ssh-connection'.
19:07:20.102 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.104 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (240 bytes).
19:07:20.105 Verbose SSH: Session 1: Sent packet SSH_MSG_PACKET60 (192 bytes).
19:07:20.114 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (384 bytes).
19:07:20.116 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.116 Debug SSH: Session 1: Unable to authenticate 'tester' using a private key.
19:07:20.118 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.119 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (528 bytes).
19:07:20.120 Verbose SSH: Session 1: Sent packet SSH_MSG_PACKET60 (480 bytes).
19:07:20.125 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (592 bytes).
19:07:20.127 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.129 Debug SSH: Session 1: Unable to authenticate 'tester' using a private key.
19:07:20.130 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.132 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (96 bytes).
19:07:20.133 Verbose SSH: Session 1: Sent packet SSH_MSG_PACKET60 (64 bytes).
19:07:20.135 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_INFO_RESPONSE (80 bytes).
19:07:20.136 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.138 Debug SSH: Session 1: Response from 'tester' not accepted.
19:07:20.138 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.140 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (96 bytes).
19:07:20.141 Verbose SSH: Session 1: Sent packet SSH_MSG_PACKET60 (64 bytes).
19:07:20.149 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_INFO_RESPONSE (80 bytes).
19:07:20.156 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.162 Debug SSH: Session 1: Response from 'tester' not accepted.
19:07:20.169 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.176 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (96 bytes).
19:07:20.182 Verbose SSH: Session 1: Sent packet SSH_MSG_PACKET60 (64 bytes).
19:07:20.188 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_INFO_RESPONSE (80 bytes).
19:07:20.194 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.200 Debug SSH: Session 1: Response from 'tester' not accepted.
19:07:20.207 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.213 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (144 bytes).
19:07:20.219 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.225 Debug SSH: Session 1: Invalid password for 'tester'.
19:07:20.231 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.241 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (144 bytes).
19:07:20.248 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.254 Debug SSH: Session 1: Invalid password for 'tester'.
19:07:20.261 Verbose SSH: Session 1: Sent packet SSH_MSG_USERAUTH_FAILURE (80 bytes).
19:07:20.267 Verbose SSH: Session 1: Received packet SSH_MSG_USERAUTH_REQUEST (144 bytes).
19:07:20.274 Info Server: Session 1: Authentication for 'tester' failed.
19:07:20.281 Debug SSH: Session 1: Invalid password for 'tester'.
19:07:20.290 Error SSH: Session 1: Authentication canceled. Error: Rebex.Net.Protocols.Ssh.AGZ: Authentication canceled. ---> Rebex.Net.Protocols.Ssh.AGZ: Authentication canceled.
   at Rebex.Net.Protocols.Ssh.VTZ.KZ()
   at Rebex.Net.Protocols.Ssh.VTZ.SZ(MHZ H)
   at Rebex.Net.Protocols.Ssh.VTZ.SZ(BAZ H, RZZ S)
   at Rebex.Net.Protocols.Ssh.CGZ.VT(Int32 H, Int32 S)
   --- End of inner exception stack trace ---
   at Rebex.Net.Protocols.Ssh.CGZ.VT(Int32 H, Int32 S)
   at Rebex.Net.Protocols.Ssh.CGZ.VT()
   at Rebex.Net.Protocols.Ssh.CGZ.AT(Int32 H, Int32 S, Int32 K, Int32 E, SocketException F)
19:07:20.297 Verbose SSH: Session 1: Sent packet SSH_MSG_DISCONNECT (64 bytes).
19:07:20.300 Error Server: Session 1: Error: Rebex.Net.Protocols.Ssh.AGZ: Authentication canceled. ---> Rebex.Net.Protocols.Ssh.AGZ: Authentication canceled.
   at Rebex.Net.Protocols.Ssh.VTZ.KZ()
   at Rebex.Net.Protocols.Ssh.VTZ.SZ(MHZ H)
   at Rebex.Net.Protocols.Ssh.VTZ.SZ(BAZ H, RZZ S)
   at Rebex.Net.Protocols.Ssh.CGZ.VT(Int32 H, Int32 S)
   --- End of inner exception stack trace ---
   at Rebex.Net.Protocols.Ssh.CGZ.VT(Int32 H, Int32 S)
   at Rebex.Net.Protocols.Ssh.CGZ.VT()
   at Rebex.Net.Protocols.Ssh.CGZ.AT(Int32 H, Int32 S, Int32 K, Int32 E, SocketException F)
19:07:20.307 Info Server: Session 1: Closed connection from 10.4.3.27:25999.
Applies to: Tiny SFTP Server

1 Answer

0 votes
by (148k points)

According to the log, the client is attempting to authenticate using its key, but the server is unable to map the key to the user. This would occur if the private key used by the client did not correspond to the user public key at the server.

I tried setting up an instance of TinySftpServer in the same way (download a ZIP with executable, config files and keys), but I'm able to connect fine using OpenSSH's SFTP client:

sftp -P 22 -i userkey.pri serveraddress

Please check it out and let us know whether you have set up anything differently.

By the way, you appear to be using OpenSSH_3.5p1, which is rather old. However, this is unlikely to be the cause of the issue.

...