Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Why SSH Asks for a Password Even With an SSH Key Set Up

A password prompt after SSH key setup can mean a failed public-key attempt or an intentional second factor. This guide shows how to tell which, trace the key with ssh -vvv, verify AuthorizedKeysFile and permissions, handle Windows paths and ACLs, and test safely before changing fallback policy.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If SSH asks for the remote account password after you configured a key, the key authentication attempt either did not complete or the server deliberately requires another method. First identify which secret the prompt wants: a local private-key passphrase unlocks your encrypted key, while a remote password is supplied to the server. Run ssh -vvv to see which identity is offered, then verify the username, host, authorized-key path, permissions, and server authentication policy.

Two prompts that look similar but mean different things

SSH can request a secret from you for two unrelated reasons. The wording and timing of the prompt are the quickest clues.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Prompt Where the secret is used What it usually means Typical next action
Private-key passphrase Your local SSH client The private key is encrypted and must be unlocked before the client can use it. Enter the passphrase you chose when creating the key, or load the key into an agent.
Remote account password The SSH server Public-key authentication was not accepted, or server policy requires password or keyboard-interactive authentication as another step. Inspect the connection with verbose logging and check the server account, key path, permissions, and policy.

SSH public-key authentication uses an asymmetric pair: a private key stays on the client and a corresponding public key is installed for the remote account. The server validates that the client can prove possession of the matching private key. A passphrase protects the private key file; it is not the password for the server account.

What the password fallback tells you

A remote password prompt means the server has offered password or keyboard-interactive authentication, or that a multi-step rule has reached that stage. It does not, by itself, prove that your key is absent. The key may have been offered and accepted as the first factor while the server waits for a second factor, such as a password.

#1 Best Overall
Yubico - Security Key C NFC - Basic Compatibility - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

If the server is intended to allow key-only login, a password prompt normally indicates a failure somewhere in the key path:

  • The command uses the wrong username or hostname.
  • The client is offering a different key than the one installed on the server.
  • The private key cannot be read, is not loaded in the agent, or is protected by a passphrase you have not entered.
  • The public key is installed for another account or on another server.
  • The server is looking in a different AuthorizedKeysFile or obtaining keys through an AuthorizedKeysCommand.
  • Ownership or permissions on the home directory, .ssh, or authorized_keys cause the daemon to ignore the file.
  • Server policy disables public-key authentication or requires an additional method.

Step 1: identify the exact connection and key being used

Run the connection with maximum client-side verbosity and explicitly name the private key:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ssh -vvv -i ~/.ssh/id_ed25519 [email protected]

Replace the path, username, and hostname with the values for your connection. The debug output should let you confirm:

  • the username SSH is actually sending;
  • the hostname and resulting destination you intended;
  • which identity files the client considers;
  • whether the intended public key is offered to the server; and
  • the point at which the server accepts, rejects, or moves on to another method.

If your key has another filename, use that exact path with -i. You can make the choice persistent in the client configuration by defining the host, username, and identity file in ~/.ssh/config. A verbose run is more useful than guessing because it separates “the client never offered this key” from “the server rejected a key that was offered.”

When the log shows the wrong identity

Multiple keys are common on a workstation. An agent may contain several identities, or the default filenames may not include the key you created. If the debug trace never offers the intended key, point SSH at it with -i, load it into the agent, or set the identity in ~/.ssh/config. Keep the private key on the client; only its matching public key belongs on the server.

When the private key cannot be used

A private key that is unreadable, inaccessible to your user, or still locked by its passphrase cannot produce the proof the server needs. Correct the local file access or unlock the key, then repeat the same verbose command. Do not copy a private key to the server to “make the pair match”; the server needs only the public half.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 2: verify the remote username and host before touching files

The public key is authorized per account. A key installed under /home/alice does not authenticate a connection made as bob, even on the same machine. Likewise, a key placed on one server cannot authenticate you to a different host that happens to have a similar name.

Compare the command’s user@host with the account and server where you installed the key. A typo in either part can produce a completely legitimate password prompt from the wrong destination.

Step 3: check the server’s effective authorized-key location

OpenSSH reads user public keys from the path defined by AuthorizedKeysFile. Its documented default is:

.ssh/authorized_keys .ssh/authorized_keys2

These relative paths are resolved from the target user’s home directory unless the server configuration specifies an absolute path or another location. Therefore, the key must be installed for the same account named in your SSH command, in that account’s effective home directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Thetis Nano-A FIDO2 Security Key Hardware Passkey Device with USB Type A, TOTP/HOTP, FIDO2.0 Two Factor Authentication 2FA MFA, Works with Windows/mac/iOS/Android/Linux/Gmail/Facebook/GitHub/Coinbase
  • Ultra-Compact FIDO2 Security Key - Plug-and-stay or carry on a keychain. This USB-A hardware security key offers portable, always-on protection for desktop and mobile use. (Item Size: 0.75 X 0.74 IN x 0.25 IN)
  • USB-A Hardware Key for All Devices - Works with USB-A ports on PC, Mac, Android, and other laptop/notebook device. Enables secure, cross-platform login with FIDO2.0 passkey support.
  • FIDO Certified Security Key - Meets FIDO and FIDO2 standards. Works with Google, Microsoft, GitHub, Dropbox, and more. Please check service compatibility before purchase.
  • Passwordless Login with Passkey - Supports passkey login via WebAuthn and CTAP2. Enjoy password-free sign-ins where supported. Not all websites or services currently support passkeys.
  • Advanced Multi-Factor Authentication - Offers 200 FIDO2 passkey slots and 50 OATH-TOTP slots. Strong, flexible 2FA/MFA support across various apps and authentication platforms.

Do not assume the default is active. Server configuration can change it, include other files, apply account- or group-specific Match rules, or use AuthorizedKeysCommand to obtain keys dynamically. Check the effective configuration rather than only the main file you happen to open.

  • Confirm the public-key line is present in the file the daemon actually reads.
  • Confirm it is under the correct user’s home directory.
  • Confirm the line is intact: a wrapped, truncated, or altered key is a different key.
  • If keys are supplied by an AuthorizedKeysCommand, verify that command and its account-specific output instead of editing a local file that the server never consults.

Step 4: correct ownership and permissions without guessing

OpenSSH can reject an otherwise correct key when the path is considered unsafe. Ubuntu’s SSH troubleshooting guidance specifically calls out overly open permissions on the home directory, .ssh, or authorized_keys. The daemon must be able to reach the file while preventing other users from replacing or modifying it.

Use the ownership and restrictive permission scheme documented for your operating system and local policy. The home directory and .ssh directory should belong to the target account (or the platform’s approved administrative owner), and authorized_keys must not be writable by unrelated users. Avoid blindly applying a numeric mode copied from another system: a mode that is appropriate for one installation can conflict with a distribution’s ownership model or centralized access controls.

After correcting the path, ownership, or permissions, rerun the same ssh -vvv command. If the server still skips the key, continue to policy checks rather than repeatedly changing file modes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 5: inspect the server’s effective authentication policy

The daemon can be configured to allow public keys, passwords, keyboard-interactive authentication, or combinations of them. The available OpenSSH methods include publickey, password, and keyboard-interactive, among others.

Review the active configuration, included files, and any Match blocks for the account and source address. In particular, establish:

  • PubkeyAuthentication is enabled for this connection.
  • AuthorizedKeysFile points to the location where the public key was installed, unless an AuthorizedKeysCommand is intentionally supplying it.
  • No account- or group-specific rule selects a different key path or authentication set.
  • AuthenticationMethods does not intentionally require a password or keyboard-interactive step after the key.

If you administer the server, validate configuration changes before restarting the SSH service. Keep password authentication available and open a second session while testing key login. Only disable password fallback after a new key-authenticated session has succeeded; otherwise a small path or permission mistake can lock out every administrator.

Why a key can succeed and a password prompt can still be expected

AuthenticationMethods can require a sequence such as:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
AuthenticationMethods publickey,password

With that policy, the server must complete both methods in order. The key proves possession of the private key, and the password supplies the second factor. A password prompt at that point is the intended security control, not evidence that the key was ignored.

Each method named in an AuthenticationMethods rule must also be enabled in the server configuration. If a policy uses keyboard-interactive rather than password, the prompt may be generated by a keyboard-interactive mechanism even though it looks like a normal password request.

Rank #3
FIDO2 U2F Security Key Passkey Two-Factor Authentication (2FA) USB Key PIN+Touch (Non-Biometric) USB-A Type TrustKey T110
  • Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
  • Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
  • Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
  • Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
  • For the driver download and user guide, please visit TrustKey Solutions Home support page.
Observed behavior Most likely layer Interpretation
No intended key appears in verbose output Client identity selection The client is using another filename, an agent without the key, or a key it cannot read.
Intended key is offered but rejected Server lookup or account mapping The server cannot find that public key for this user, or the key path is unsafe.
Key is accepted, then another prompt appears Authentication policy A rule requires an additional password or keyboard-interactive method.
Password prompt comes from an unexpected destination Connection identity The username or hostname may not be the account and host where the key was installed.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Windows OpenSSH: paths and ACLs differ

Windows OpenSSH has platform-specific locations and access-control requirements. Microsoft documents %programdata%sshsshd_config as the default server configuration file. Changes to that file require restarting the sshd service before they take effect.

Standard user accounts

For a normal user, the public key is normally placed in the user profile’s .sshauthorized_keys. Make sure the profile belongs to the account named in the SSH command and that the file contains the complete public-key line.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Administrator accounts

Members of the Windows Administrators group may use %programdata%/ssh/administrators_authorized_keys instead of the per-user file. Microsoft specifies restrictive ACL entries for SYSTEM and BUILTINAdministrators on that file. An ACL that grants broad write access can cause the server to reject the file or create a security exposure.

After changing Windows SSH configuration or the administrator key file’s ACLs, restart sshd as required, then test from a second connection. A client-side ssh -vvv run remains useful because it shows whether the key is offered; server-side path and ACL checks explain why it is accepted or rejected.

A complete, low-risk troubleshooting sequence

  1. Classify the prompt. Decide whether it asks for the local private-key passphrase or the remote account password. Do not change server files to solve a local passphrase prompt.
  2. Run a verbose, explicit test. Use ssh -vvv -i /path/to/private_key user@host and record the username, hostname, identities considered, and authentication method transition.
  3. Confirm the destination. Verify that the host and account are exactly where the public key was installed.
  4. Confirm the key pair. Ensure the private key selected on the client corresponds to the public-key line installed for that account.
  5. Confirm the server lookup. Check the effective AuthorizedKeysFile, any included configuration, Match rules, and any AuthorizedKeysCommand.
  6. Confirm path safety. Correct ownership and restrictive permissions or ACLs on the home directory, .ssh, and authorized-key file according to the platform’s guidance.
  7. Check policy. Verify public-key authentication is enabled and determine whether AuthenticationMethods intentionally requires another factor.
  8. Retest before hardening. Open a second session with the key. Only then consider disabling password authentication, and retain a recovery path appropriate to your environment.

Common fixes that do not solve the real problem

Copying the private key to the server

This reverses the security model. The client proves possession of the private key; the server needs only the public key. Keep the private key local and repair the authorized-key installation or client identity selection.

Changing permissions repeatedly without checking the path

Restrictive permissions cannot help if the key is under the wrong user, on the wrong host, or in a file that AuthorizedKeysFile does not reference. Establish the effective path first, then correct ownership and access controls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Disabling password authentication immediately

This can turn a recoverable key-selection problem into a lockout. Test a new key-authenticated session while the existing session remains available, and change fallback policy only after success is demonstrated.

Assuming every password prompt means the key failed

A configured publickey,password sequence deliberately produces a password prompt after a successful key step. Inspect the verbose exchange and server policy before removing a security control.

Security choices after key login works

Once key authentication is reliable, decide whether the account should use one factor or more. Key-only access reduces reliance on a reusable account password, while a policy that combines publickey with password or keyboard-interactive provides an additional requirement. The correct choice depends on the threat model and the server’s operational requirements.

OpenSSH also supports security-key algorithms and controls such as touch-required and verify-required. Those options can require physical presence or verification when a hardware-backed key is used, but they do not repair an incorrect username, key path, ownership setting, or ACL. Fix the authentication path first, then choose any additional factor deliberately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the final diagnosis should say

An accurate diagnosis identifies both the prompt and the failing layer: local passphrase protection, client key selection, server key lookup, filesystem or ACL safety, or an intentional multi-factor policy. The same visible “password” question can represent any of these states, so the reliable method is to read the verbose client exchange and compare it with the server’s effective configuration for the exact account and host.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.