Software⏱️ 4 min read📅 2026-06-19

How to Fix: OpenSSH giving a "Failed to open file" error because it is looking for non existent -cert files

OpenSSH error with non-existent certificate files.

Quick Answer: Set the configuration option 'IdentityFile' instead of 'IdentitiesOnly' to specify the private key file.

OpenSSH is experiencing an issue where it's unable to find non-existent certificate files, causing a 'Failed to open file' error. This affects users who are trying to log in to an SSH server using a private key generated with ssh-keygen on their Windows machine.

This error can be frustrating for users who have previously used OpenSSH without issues. However, it's essential to understand the root cause and follow the correct steps to resolve the problem.

🛑 Root Causes of the Error

  • The primary reason for this issue is that OpenSSH is configured to require certificate files by default when using private keys. This is a security measure to verify the authenticity of the key. However, since you've generated your own private key with ssh-keygen, it doesn't come bundled with a certificate file. As a result, OpenSSH is unable to find the non-existent certificate files.
  • An alternative reason for this issue could be that there's an incorrect or outdated configuration file in the .ssh directory. This might occur if you've made changes to the ssh_config file or if it's not properly synchronized between different systems.

🚀 How to Resolve This Issue

Using the -i option with the correct path

  1. Step 1: Open a command prompt and navigate to the directory where your private key file is located. The file should be named 'rsa_key_file' (without the '.pub' extension).
  2. Step 2: Enter the following command, replacing 'domain.edu' with the actual domain name of the SSH server you're trying to connect to: ssh -i ~/.ssh/rsa_key_file username@domain.edu -vvv.
  3. Step 3: This will tell OpenSSH to use your private key file instead of looking for certificate files. Note that this method assumes you have generated a private key using ssh-keygen, which is the case in your scenario.

Setting IdentitiesOnly to yes

  1. Step 1: Open the ssh_config file located in the .ssh directory of your home directory (usually C:\Users\usr\.ssh).
  2. Step 2: Add the following line at the end of the file: IdentitiesOnly yes. This will instruct OpenSSH to use only private keys for authentication, bypassing the certificate files.
  3. Step 3: Save and close the ssh_config file. Restart the SSH service or reconnect to the server to apply the changes.

✨ Wrapping Up

To resolve the 'Failed to open file' error when using OpenSSH on Windows, you can try one of two methods: (1) specify the correct path to your private key file using the -i option or (2) set IdentitiesOnly to yes in the ssh_config file. Both methods should help you bypass the certificate file issue and successfully connect to the SSH server.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions