Share this article
This article is translated in
Improve this guide
Windows SSH Permission Denied: 5 Ways to Fix it
Follow our tested procedures to solve the issue right away
5 min. read
Updated onOctober 4, 2023
updated onOctober 4, 2023
Share this article
This article is translated in
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
Key notes
SSH, or Secure Socket Shell, is an encrypted protocol that enables secure access to any remote device or server over an unsecured network.
When some of our readers tried to authenticate using these keys, they received an SSH permission denied message on their Windows 11 PC.
The users can unaware of the causes of this type of error message on the system. This is impacting the productivity of their work.
Some users also faced theSSH exchange identification erroron the system but the link will bring you to a helpful guide to fix it.
Why do I get SSH permission denied message in Windows 11?
There could be a number of factors responsible for this error message, which are listed below:
If you are encountering this problem on your Windows 11 PC, this article will walk you through the five best solutions available, which are detailed below.
How do I bypass the SSH permission denied in Windows 11?
1. Check if you are connecting to the right server
This might sound silly, but many users tend to make this mistake and wonder why they are facing such an error message on their system.
When you are trying to connect to a server using the SSH key and the server address, you need to recheck the server address two to three times before trying to access it.
There might be a possibility of missing a few numbers or misplacing the numbers in the server address. So always confirm the server address before continuing.
2. Try to log in with a password
You can always try logging in to the server using the password method. But for this to work, you need to enable the Password Authentication feature.
If it is already enabled, then you can access the server using the following command line:
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no[email protected]
In the above command, you have to replace[email protected]with theactual server addressandpasswordwith thereal password.
If the PasswordAuthentication is disabled, first you need to enable it and then generate a new ssh key using the following command:ssh-keygen -R server.IP.address
You have to replace theserver.IP.addresswith thereal IP address of the server.
3. Add your SSH key to the VPS server
In this method, you are trying to add the SSH key created on the system to the VPS server. This can be done by first generating a new SSH key on the system using the following command:ssh-keygen -t rsa
Now you might have to add this SSH key to the server by following this command:ssh-copy-id[email protected]
Here, you have to change theserver.ip.addressto the actual server address value and execute the command.
Also, disable thePassword authenticationfeature and edit thessh_configfile for changing the sole authentication method to SSH keys.
4. Manually select the key to use
When there are too many SSH keys available in the system, it can choose any random SSH key and create such issues.
So, you can execute the following command for making it choose the SSH key provided by you in the command:ssh -i /users/user_name/.shh/id_rsa[email protected]
Before executing the command, you have to replace/users/user_name/.shh/id_rsawith the path of the SSH key you want to add and[email protected]with the actual values.
5. Change the permissions of your SSH key
Where are SSH keys stored in Windows?
All the SSH keys are stored on the system drive in the following folder (replace username with the actual name):C:\Users\username.ssh
Of course, if your system drive has another letter, you should replace the letter in the path above with your own.
Hope this article was worth reading and was able to resolve the SSH Permission denied issue.
You should also consult our guide onhow to fix bad owner or permissions on SSH configbecause it might offer some additional information.
Our readers also complained that they encountered theUnable to establish host authenticityerror. If you’re among them, read the highlighted guide for instructions to fix it.
If you know any other possible solutions for this problem or would like to ask something about this problem, use the comments section below.
More about the topics:Permission error,Windows 11
Vladimir Popescu
Being an artist his entire life while also playing handball at a professional level, Vladimir has also developed a passion for all things computer-related.
With an innate fascination for research and analysis, and realizing many other people share his passion for this subject, he delved into writing Windows-related articles, so other people can also benefit from the acquired information.
When not writing kick-ass articles, Vladimir likes to spend his time doing Crossfit and creating art.
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
Vladimir Popescu