To force OpenSSH to ask for a server account password instead of using an SSH key, set PreferredAuthentications=password and PubkeyAuthentication=no for that connection. Your private keys and SSH agent remain untouched.
This works in Windows PowerShell, Linux and macOS when the server allows the password method. If the server accepts only public keys or requires a key before a password, client-side flags cannot bypass that policy.
| What you want | What to do |
|---|---|
| Ask for the account password | PreferredAuthentications=password plus PubkeyAuthentication=no |
| Avoid the private-key passphrase prompt | Stop public-key attempts for this connection; server password login must still be enabled |
| Find out why there is no password prompt | Inspect ssh -G and ssh -vv output |
| Keep the option for one machine | Use a host-specific entry in ~/.ssh/config |
Force SSH to Use a Password Instead of a Key
For a single login, use the following client-side override. It does not change any setting on the SSH server:
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@hostPreferredAuthentications=password selects the SSH protocol method named password. PubkeyAuthentication=no explicitly prevents offers from identity files and ssh-agent. Using both makes the intent unambiguous, even though selecting only password would ordinarily exclude public keys already.
If a global client setting explicitly disables password authentication, add -o PasswordAuthentication=yes to your command. That enables the method in your client; it cannot turn it on at the server. Use -p 2222 if your SSH service actually listens on port 2222, or keep the default port 22.
ssh -p 2222 -o PreferredAuthentications=password -o PubkeyAuthentication=no user@hostImportant: a request for Enter passphrase for key ... unlocks a local private key; a prompt resembling user@host's password: usually requests a server account password. They are not interchangeable.
Verify That SSH Is Not Using Your Key
Start by seeing what your ordinary login does. On a host where a key is accepted, ssh -v user@host may report that it is offering a public key and then authenticating with publickey. That establishes the baseline; a key configured on one machine may not work on another.
ssh -v user@host
Next, confirm the effective client settings without contacting the server. In Linux or macOS:
ssh -G -o PreferredAuthentications=password -o PubkeyAuthentication=no -o PasswordAuthentication=yes user@host | grep -E "^(preferredauthentications|pubkeyauthentication|passwordauthentication|batchmode) "In Windows PowerShell, use Select-String instead of grep:
ssh -G -o PreferredAuthentications=password -o PubkeyAuthentication=no -o PasswordAuthentication=yes user@host | Select-String "^(preferredauthentications|pubkeyauthentication|passwordauthentication|batchmode) "Look for preferredauthentications password, pubkeyauthentication no and passwordauthentication yes. ssh -G proves which settings the client would use; it does not prove that a remote server accepts the password method.

Verify a Successful Password Login
The most convincing test is a successful login where verbose output confirms the method. Perform this on a disposable SSH account or a local test container with password login deliberately enabled. Do not enable password login for root on a production VPS solely for a screenshot.
ssh -vv -p 2222 -S none -o PreferredAuthentications=password -o PubkeyAuthentication=no -o PasswordAuthentication=yes [email protected]The example uses a locally hosted SSH lab on port 2222; it is not intended for the production host. When the test succeeds, look for Next authentication method: password, the interactive prompt, and a message like Authenticated to ... using "password". The exact log format varies by OpenSSH version. -S none disables connection-socket reuse so an old authenticated session does not hide the new authentication exchange.

For the exact safe Docker setup used to produce this result, follow the separate ShadeTerm screenshot guide. A password prompt alone is not evidence of a successful login: capture the completion message or the authenticated shell.
Why SSH Does Not Ask for a Password
A correct client command cannot force a server to offer a method it has disabled. If you see Permission denied (publickey) after requesting password-only authentication, the server may currently advertise only public keys, or it may require a public-key step before another method becomes available.
ssh -vv -S none -o PreferredAuthentications=password -o PubkeyAuthentication=no user@hostIn verbose output, Authentications that can continue: publickey means that password is not offered at that stage. If it does offer password but rejects the credentials, the diagnosis is different. Check the account, password, PAM/account rules and server logs rather than retrying the same flags indefinitely.

| Observed symptom | Likely explanation | Next useful check |
|---|---|---|
Permission denied (publickey) | Server offers publickey only at this stage | ssh -vv, then server policy if you administer it |
Permission denied (publickey,password) | Password is advertised, but authentication did not succeed | Correct username, account status and server auth logs |
keyboard-interactive, but no password | PAM, challenge or MFA policy uses another method | Try keyboard-interactive only if the server permits it |
BatchMode yes | Your client suppresses prompts | ssh -G, interactive BatchMode=no test |
| No prompt and immediate success | Connection multiplexing may reuse a session | Retest with -S none |
Password vs Keyboard-Interactive Authentication
The words “password prompt” and the SSH method password are not always equivalent. A Linux SSH server can also use keyboard-interactive, sometimes backed by PAM or MFA. It may request a password-like answer or an OTP even when the ordinary SSH password method is disabled.
ssh -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no -o KbdInteractiveAuthentication=yes user@hostThis explicitly permits a keyboard-interactive challenge before the regular password method. It is not a bypass of MFA, and a keyboard-interactive prompt can request more than a password.
For a server with AuthenticationMethods publickey,password, password-only cannot work: publickey must succeed before password is offered. Follow the authorized server policy or speak to its administrator. See the OpenSSH server configuration manual for the method sequences.
Client Options vs Server Password Policy
All the -o options above configure the client. The server is independently responsible for permitting password authentication, keyboard-interactive prompts, account access and root login. On a Linux server you administer, check its effective global settings without editing anything:
/usr/sbin/sshd -T | grep -E "^(passwordauthentication|kbdinteractiveauthentication|pubkeyauthentication|authenticationmethods|permitrootlogin) "If you are not root, use sudo /usr/sbin/sshd -T. This check reads server configuration; Match rules may need connection-specific evaluation through sshd -T -C user=...,host=...,addr=.... A root account can be denied password login by PermitRootLogin even when password authentication is enabled for other accounts.

sshd -T result may differ from a user-specific Match configuration.Our test VPS does not need its configuration changed to perform this inspection. Do not enable root password authentication, change PermitRootLogin, remove MFA or disable host-key checking merely to recreate a tutorial screenshot. Consult our sshd_config guide before making authorized server-side changes.
Force a Password for One Host in SSH Config
If you routinely connect to one test host with a password, put the override in that host’s local SSH client configuration rather than applying it to every server. For example:
Host password-lab
HostName 127.0.0.1
Port 2222
User labuser
PreferredAuthentications password
PubkeyAuthentication no
PasswordAuthentication yesWith the local Docker lab running, connect using ssh password-lab and inspect it with ssh -G password-lab. On Unix-like clients the file is usually ~/.ssh/config; on native Windows OpenSSH it is normally %USERPROFILE%\.ssh\config.
For most settings OpenSSH uses the first value it obtains, so place specific Host entries before broad Host * defaults. A host alias is a preference, not proof of server support. See our SSH config examples for more on precedence.
Windows PowerShell, Linux and macOS Notes
The same OpenSSH -o flags work on Linux, macOS and Windows PowerShell when the OpenSSH client is installed. They do not automatically apply to PuTTY, which has its own settings. WSL may use a separate SSH binary and configuration from native Windows.
Password, passphrase, and prompts
Enter passphrase for key ... means the local key needs unlocking. It does not mean the server rejected your account password. Password-only testing suppresses key offers for this invocation, but routine SSH access is generally better protected by keys and an SSH agent.
BatchMode and connection sharing
If prompts never appear, check ssh -G host for batchmode yes or a configured control socket. For an interactive diagnostic session, add -o BatchMode=no -S none. Do not expect human password prompts inside an unattended script.
Host verification still applies
On the first connection, verify the host-key fingerprint through a trusted source. On a changed host key, investigate the reason instead of using StrictHostKeyChecking=no.
Use Password Authentication with SCP and SFTP
scp and sftp use SSH authentication and pass OpenSSH-style -o options to the underlying connection. On a server that permits passwords:
scp -o PreferredAuthentications=password -o PubkeyAuthentication=no ./file.txt user@host:/tmp/
sftp -o PreferredAuthentications=password -o PubkeyAuthentication=no user@hostFor a locally exposed password-lab container on port 2222, a temporary test transfer can use scp -P 2222 ... [email protected]:.... Remember: scp uses uppercase -P for the port, while ssh uses lowercase -p.
These flags select authentication; they do not make a missing SFTP subsystem or an unwritable destination work. For everyday file browsing, ShadeTerm uses SFTP alongside the terminal, rather than claiming to implement the legacy SCP protocol. Read our SCP for Windows and SCP vs SFTP guides for transfer-specific troubleshooting.
FAQ, Troubleshooting and Official References
How do I force SSH to ask for a password instead of a key?
Run ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@host. The server must permit password authentication.
Why do I still get Permission denied (publickey)?
The server may advertise only publickey at that stage or require a key before a second method. Use ssh -vv to inspect the actual authentication exchange.
Can I force a password without deleting or renaming my SSH keys?
Yes. The flags affect one invocation and do not modify keys or the SSH agent.
Does PasswordAuthentication=yes override the server?
No. It only controls the client's willingness to use password authentication. Server-side policy is separate.
Does this work in PowerShell?
Yes, with Windows OpenSSH Client installed. Replace grep in debugging examples with Select-String.
Can I enter the SSH password directly in the command?
The normal OpenSSH client has no --password option. Avoid embedding plaintext passwords in arguments, shell history or scripts.
Official documentation and community references
- OpenSSH ssh(1) — flags, -G, verbose mode and multiplexing
- OpenSSH ssh_config(5) — PreferredAuthentications, PubkeyAuthentication and client policy
- OpenSSH sshd_config(5) — PasswordAuthentication, Match and AuthenticationMethods
- Unix & Linux Stack Exchange — force password-only SSH
- Super User — password instead of a key
- Server Fault — password prompt versus key passphrase
Bottom line: use the password-only client flags for a specific connection; verify what the client selected with ssh -G and what the server offered with ssh -vv. The server's authentication policy remains in control.