However, while using a public key sometimes the connection request of the SSH Client is rejected by the Server which can cause SSH permission denied error. This article will demonstrate different solutions for fixing the “SSH Permission denied” error, but before that, let’s have a look at the reason for this error. There are a couple of reasons which can cause this Error to occur. One of the most common reasons is that password authentication is disabled on the SSH Server. Another common reason for this error is not having access to the “ssh” folder which essentially means that the access to the Authorized_keys is disabled.
Solution 1: Allow password authentication on SSH server
As mentioned above, if the server has not enabled the SSH connection with password authentication, then the connection will most likely result in a failure. You have successfully resolved the error and connected to the SSH server.
Solution 2: Enable public key authentication
Sometimes, the users can get an alteration \ variation of the error in which the error state becomes “SSH Permission Denied (public key)” this error is caused by not having public authentication enabled on the SSH server. You have resolved the SSH Permission Denied (Public Key) error.
Solution 3: Allow permission to SSH directory
Oftentimes, the public key is stored inside the authorized keys subdirectory inside the “ssh” directory and if the permissions of this sub-directory or the whole directory are not correct, then the SSH connection will ultimately return an error. The outpost depicts that the error has been resolved
Bonus fix for SSH permission denied
The error “Permission Denied” can occur when the password for the SSH Server is not correct. A typo mainly causes this, or sometimes the server has changed the password, and the client is unaware of that. In such cases, when the user provides the password for the SSH connection, the following error is displayed on the terminal: In such cases, contact SSH Server support and ask if they have changed the pass or simply recheck if you have made a typo or not. After that, you will be able to deduce the mistake and connect to the SSH Server: The SSH Permission Denied is not a new one and is mainly caused by not having password authentication enabled, not enabling public key authentication, and also by having wrong permissions on the “ssh” or the “authroized_keys” directory. This guide has elaborated on the solutions one can use to fix the error and proceed with the connection. Additionally, this error can also be caused by a change in the password by the SSH server, or by a typo. In this case, it is best to contact the SSH Server’s support or retype the password making sure that there are no typos.











