SSH/SFTP Public Key Authentication Fails w/ DSA Key and OpenSSH Server

If SSH public key authentication fails when using a DSA private key, it may be that the SSH server disallows using DSA private keys.

If the contents of the Chilkat LastErrorText for methods AuthenticatePk or AuthenticatePwPk contains the following, then this could be the cause of the error:

...
Sent public-key request.
AuthList: publickey,password
Proceeding with publickey authentication...
dssSigLen: 40
Sent public-key request with signature.
Authentication failed or partial success. (4)
PartialSuccess4: 0
...
...
AuthList: publickey,password
Publickey authentication failed..
...

The following is stated at https://www.openssh.com/legacy.html

“OpenSSH 7.0 and greater disables the ssh-dss (DSA) public key algorithm. It too is weak and we recommend against its use. It can be re-enabled using the HostKeyAlgorithms configuration option”

To enable ssh-dss for OpenSSH 7.0 or greater, edit the sshd_config file and add the following line:

PubkeyAcceptedKeyTypes=+ssh-dss

Then restart the sshd server.