I am trying to connect to an sftp using private key.
The result is "Server refused our key" (tried it with filezilla and winscp). This is the session log from winscp:
Reading key file "D:\path\to\file\mykey.ppk" Pageant is running. Requesting keys. Pageant has 2 SSH-2 keys Configured key file not in Pageant Using username "myusername". Server offered these authentication methods: publickey,gssapi-keyex,gssapi-with-mic,password Offered public key Server refused our key Server refused our key
server /var/log/secure log:
sshd: Invalid user myusername from xxx.xxx.xxx.xxx sshd: input_userauth_request: invalid user myusername
Perhaps it is important to mention that I am using bluehost VPS. The ftp account that I am trying to connect to it is in sub-cpanel account (created through WHM).
Some checks that I did:
I checked and I am able to connect to the same server through ssh using putty and the same private key. So I don't know why is the server refusing the key when trying to connect to it using sftp.
I checked and I was able to connect to the server using normal ftp mode (username+password)
It seems that sftp also works, but to the user account, not to the ftp account (with the private key).
The ftp account was created through cpanel of the sub-cpanel account.
I run sshd in debug mode using "/usr/sbin/sshd -d" and this is the error:
PAM: password authentication failed for an illegal user: User not known to the underlying authentication module
So I believe that PAM recognize only the user account (for both putty&sftp), but not for the ftp account.