We use Copssh and we are having an issue getting Public Keys to properly work when connecting our SFTP. I've looked up as much as I could related to permissions, steps, etc. but I get a "Server refused our key" message.
What I did was created a key pair within Copssh, imported the private key into Puttygen, made sure the key was in the .ssh\authorized_keys file, and attmepted to connect in Filezilla and WinSCP. I also made sure to add +ssh-rsa to PubkeyAcceptedKeyTypes but still get the same message. I also confirmed I see this setting in my sshd_config file but when connecting, these 2 lines appear in the server's logs:
2022.07.13 10:41:32 - Failed publickey for devjoesftp2 from 10.81.70.3 port 64080 ssh2: RSA SHA256:GYnkAY7gsrTwT69r6XdEwVXOYb9F8KnguCGsX1/bMS02022.07.13 10:41:32 - debug3: mm_answer_keyallowed: publickey authentication test: RSA key is not allowed
My Filezilla sees this:
Trace: Connecting to 10.81.64.205 port 22Trace: We claim version: SSH-2.0-FileZilla_3.60.1Trace: Connected to 10.81.64.205Trace: Remote version: SSH-2.0-OpenSSH_9.0Trace: Using SSH protocol version 2Trace: Doing ECDH key exchange with curve Curve25519 and hash SHA-256 (unaccelerated)Trace: Server also has ecdsa-sha2-nistp256/rsa-sha2-512/rsa-sha2-256/ssh-rsa host keys, but we don't know any of themTrace: Host key fingerprint is:Trace: ssh-ed25519 255 SHA256:u4M+vpXf76UpFltUCPRDuv4dyiOmCa+/hxvEBwTnW4YTrace: Initialised AES-256 GCM outbound encryptionTrace: Initialised AES256 GCM outbound MAC algorithm (in ETM mode) (required by cipher)Trace: Initialised AES-256 GCM inbound encryptionTrace: Initialised AES256 GCM inbound MAC algorithm (in ETM mode) (required by cipher)Trace: Successfully loaded 1 key pair from fileStatus: Using username "devjoesftp". Trace: Offered public key from "C:\Temp\SFTPTesting\devjoesftp1.ppk"Status: Server refused our key Trace: Server refused our keyTrace: Attempting keyboard-interactive authenticationTrace: Server refused keyboard-interactive authenticationCommand: Pass: Trace: Sent passwordTrace: Password authentication failedStatus: Access denied Error: Authentication failed.Trace: CControlSocket::DoClose(1030)Trace: CControlSocket::ResetOperation(1094)Trace: CSftpConnectOpData::Reset(1094) in state 3Error: Critical error: Could not connect to serverTrace: CFileZillaEnginePrivate::ResetOperation(1094)
Any help is greatly appreciated on this as I have been stumped on this for days and know I'm missing something as when using Copssh's labs, I cannot reproduce this issue.