Skip to main content

SSH prompts me for a password

Problem

I tried connecting over SSH with a .pem key, but SSH asks me for a password.

Cause

If the SSH command is malformed or the private key isn't specified correctly, SSH falls back to password authentication instead of key-based authentication.

Solution

  1. Use the correct SSH command form:

    ssh -i elice-cloud-ondemand-xxxx.pem username@host
  2. Check that the .pem file is in your current directory:

    ls

    Or specify the full path:

    ssh -i /path/to/elice-cloud-ondemand-xxxx.pem username@host
  3. Make sure you're running the command from the directory that contains the private key.

Additional Notes

If the .pem file isn't specified correctly, SSH automatically falls back to password login.