Putty Fatal Error: Server Refused Key Connection in Oracle Cloud

Abstract: Resolve Putty fatal error server refused key connection on Oracle Cloud by converting OpenSSH keys to PPK format and verifying authorized keys.

Created: 2026-10-06 by
The "Putty Fatal Error: Server Refused Key Connection" on Oracle Cloud typically occurs because the SSH client is using an incorrect private key file or the public key was not correctly registered in the cloud instance's authorized keys. This authentication failure prevents the handshake from completing, resulting in an immediate rejection by the server before any session can be established.

Understanding the Authentication Mismatch

When you attempt to connect to an Oracle Cloud Infrastructure (OCI) Compute instance via PuTTY, the software acts as an SSH client. The error message indicates that the server has received your connection request but refuses the specific credentials provided. In the context of SSH, this almost always points to a mismatch between the private key file you are presenting and the public key stored on the remote server. Oracle Cloud instances often generate a default key pair during provisioning. If you are trying to use a different key, or if the key file format is incompatible, the server will reject the attempt. It is crucial to verify that the private key you are loading into PuTTY corresponds exactly to the public key associated with the OCI compartment and the specific compute instance.

Converting Keys for PuTTY Compatibility

One of the most common causes of this error is using a standard OpenSSH private key file directly within PuTTY. PuTTY uses its own proprietary format called PPK (PuTTY Private Key), whereas modern Linux systems and Oracle Cloud typically generate keys in the OpenSSH PEM format. If you try to load a raw .pem or .ppk file without converting it first, PuTTY may fail to parse it correctly, leading to authentication errors. To resolve this, you must convert your existing OpenSSH private key into the PPK format. You can do this using the PuTTYgen tool, which is installed alongside PuTTY on Windows systems. Follow these steps to ensure compatibility:
  • Open PuTTYgen from your Start menu.
  • Click the Load button and select your original private key file (usually ending in .pem or .key).
  • If prompted about the passphrase, enter it if you set one; otherwise, leave it blank.
  • Once loaded, click Save private key.
  • Save the new file with a .ppk extension.
After saving the converted key, go back to your PuTTY session configuration. In the left-hand tree menu, navigate to Connection > SSH > Auth. Under the "Private key file for authentication" field, browse and select the newly created .ppk file. Ensure that no other key files are selected in this list, as having multiple conflicting keys can sometimes cause the client to present the wrong one. Plink Access Granted: Nothing Occurs Even with Correct Credentials? explores similar credential handling issues when using command-line SSH tools, which can provide further insight into how clients manage key selection.

Verifying OCI Instance Configuration

Even with the correct key file, the server-side configuration must allow the key for login. Oracle Cloud instances rely on the ~/.ssh/authorized_keys file on the remote machine. When you launch an instance via the OCI Console, you usually specify a key pair. If you did not upload a custom public key, OCI generates a default one. You must ensure that the public key corresponding to your private key is actually present in the authorized_keys file of the user account you are trying to access (typically opc or root). If you recently changed the key pair in the OCI console, the old keys may have been removed, or the new public key may not have propagated to the instance yet. If you suspect the key is missing from the server, you may need to access the instance through the OCI Serial Console or VNC if available, to manually append the public key to the authorized_keys file. This step requires direct access to the operating system and bypasses the network SSH layer entirely.

Checking Network and Security List Rules

While less common for this specific error message, network security lists can sometimes interfere with the initial handshake. Ensure that your Virtual Cloud Network (VCN) allows inbound traffic on port 22 (SSH) from your IP address. However, note that if the connection were blocked by a firewall, you would typically see a timeout or "Connection refused" due to network unreachability, rather than a key refusal. The key refusal confirms that the packet reached the SSH daemon, but the cryptographic exchange failed. For users experiencing broader connectivity issues, such as hangs or drops, reviewing general SSH troubleshooting guides can help isolate whether the problem is local or network-wide. See Troubleshooting SSH Client Connection Hangs at Start for diagnostics on persistent connection states.

Common Pitfalls and Final Checks

Always double-check the username. On Oracle Cloud Linux images, the default administrative user is opc, not root or ubuntu. Using the wrong username can lead to permission denied errors that might be misinterpreted as key failures if the key is not mapped to that specific user. Additionally, ensure that the line endings of your key file are correct; Windows-style CRLF line endings in a Linux key file can sometimes cause parsing issues in older SSH implementations. If you continue to face issues, consider generating a fresh key pair via PuTTYgen, uploading the new public key to the OCI instance metadata, and testing the connection again. This isolates whether the issue lies with the key generation process or the cloud infrastructure itself.

Frequently Asked Questions

Why does PuTTY say "Server refused key" even though I uploaded the correct key?

This usually happens because the key file format is incompatible. PuTTY requires the PPK format, while Oracle Cloud provides keys in OpenSSH PEM format. You must convert the key using PuTTYgen before loading it into the PuTTY session settings.

Can I use the same key file for PuTTY and command-line SSH?

No, not directly. Command-line SSH tools expect OpenSSH format keys, while PuTTY expects PPK format. You can keep both formats by keeping the original .pem file for CLI use and saving the converted .ppk file specifically for PuTTY.

What should I do if I lost my private key for an Oracle Cloud instance?

You cannot recover the private key if it is lost. You must generate a new key pair, upload the new public key to the instance (via serial console or VNC if necessary), and then use the new private key to connect. The old key will remain valid until replaced.

Does the SSH port number affect key authentication?

The port number does not affect the cryptographic key exchange itself, but if you are using a non-standard port (not 22), you must configure PuTTY to connect to that specific port under the Session settings. The key refusal error still applies regardless of the port, as long as the SSH service is reachable.

How can I verify if my key is in the authorized_keys file?

If you have access to the instance via another method like VNC or serial console, log in and run cat ~/.ssh/authorized_keys. Compare the content with the public portion of your key. If it is missing, append it using echo "your_public_key" >> ~/.ssh/authorized_keys.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More