rescueshell Start trial

SSH Load key "incorrect passphrase": what it means

The file is there, and ssh opened it, but the passphrase it was given did not decrypt the private key. So that key was not used. The line comes from the machine you typed the command on, not from the server.

This page describes standard OpenSSH behaviour. The commands are the usual ones, and wording differs between versions, distributions and platforms. We did not run them on your system for this page.

What the line means

Load key "/home/you/.ssh/work_ed25519": incorrect passphrase supplied to decrypt private key

The path comes from somewhere ssh was told to look: a -i option on the command line, an IdentityFile line in ~/.ssh/config, or another source that the -v output shows. The words after the colon say why the key did not load: the key is encrypted, and the passphrase offered was not the one it was encrypted with. Other reasons can follow that colon, and this page covers only this wording.

The line can be a warning, not a hard stop. ssh may go on to offer other keys, from the agent or from other files, and the login can still succeed. If it does not, the last line you see is usually Permission denied (publickey), and the earlier line is a clue to why the key you meant was never sent. Whether ssh asked you again, and how many times, depends on the version and on whether it had a terminal to ask on. A script or a tool that runs ssh without a terminal cannot ask at all.

This is a different message from the ones that sound alike, so confirm that first:

1. Read the path in the message

Copy the path exactly as printed. It is normally shown with any ~ already expanded, so it tells you which file ssh tried. If you keep more than one key, each may have its own passphrase, and a passphrase that is right for one key is wrong for another. Check that the path is the key you meant to use.

Running again with -v shows which key paths ssh tried, and the ssh -v output reader can check a pasted log for this line. It runs in your browser and sends nothing.

ssh -v user@server.example.com

2. Try the key where you can see the result

OpenSSH can report the public half of a key it can read. It asks for the passphrase if the key has one, so it tests the passphrase without connecting anywhere:

ssh-keygen -y -f ~/.ssh/work_ed25519

If it prints a public key line, the passphrase you typed is the right one for that file. If it reports the same incorrect passphrase wording, the passphrase you typed is not. Type it slowly, and check the usual causes of a mismatch: a caps lock or keyboard layout difference, a passphrase from a different key, a password manager entry that was not updated, or a passphrase that was changed later on this machine or another one that holds a copy of the file. Nothing is shown as you type, which is normal. Do not paste a private key or a passphrase into a chat, a ticket or a web page.

3. Load it into the agent, or give ssh the chance to ask

If you use an agent, adding the key asks for the passphrase once, and the agent then holds the decrypted key for later connections:

ssh-add ~/.ssh/work_ed25519
ssh-add -l

The second command lists the keys the agent holds. If the first one does not accept the passphrase, the cause is the same as in step 2. If it says no agent is running, that is a separate question that the publickey guide covers. Agent behaviour and options vary by version and platform, so check the manual page on your machine before relying on any option beyond the plain command.

If you do not use an agent, run the same ssh command from an interactive terminal so that it can prompt for the passphrase, and use -i to name the key you mean.

ssh -i ~/.ssh/work_ed25519 user@server.example.com

4. If you cannot remember the passphrase

If you know the old passphrase and want a different one, OpenSSH can change it on the file. It asks for the old passphrase first:

ssh-keygen -p -f ~/.ssh/work_ed25519

If the passphrase is lost and you have no other copy of the key, the key cannot be recovered. You would need a new key pair and its public half added to the device by another route, because a new key is a different identity.

5. Retry the same command

Run the same ssh command again. If the key now loads, the line goes away. If login still fails, the next message is the real one to read, and it is often Permission denied (publickey), which covers the account, the key on the device, and how to make ssh offer only the key you name.

If the machine is a RescueShell device

A path that starts from the device can avoid a public SSH port. The agent on the device keeps an outbound HTTPS connection to our relay, so reaching a shell does not depend on an inbound port on the device. See SSH behind a firewall without port forwarding.

A passphrase problem is on the machine you typed on, and the relay does not decrypt that key. If you still use that key file for a direct connection, it stays a problem for that connection. If a shell does not open once the agent is installed, see the shell does not open.

Try it on one device

The first device is free to try with no card, for 30 days from when it connects, not from when you sign up. Start a trial.