fix(ssh): forbid password authentication fallback - #1120
Open
mehdi653 wants to merge 1 commit into
Open
Conversation
Clever Cloud SSH only accepts key auth. Disable password fallback so a missing or unregistered key fails fast instead of prompting for a password that cannot work. Pass PreferredAuthentications=publickey and PasswordAuthentication=no to the ssh client. Fixes CleverCloud#574
mehdi653
force-pushed
the
fix/ssh-forbid-password-fallback
branch
from
August 12, 2026 22:27
5d04236 to
0c6ac92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clever Cloud SSH only accepts key authentication. When a key is missing or not registered,
clever sshused to fall back to a password prompt that can never succeed.This disables password authentication for the SSH session so the failure is immediate and clearer for users and support.
Fixes #574
Change
Pass to the ssh client:
PreferredAuthentications=publickeyPasswordAuthentication=noTest plan
clever sshwith a valid key still connectsclever sshwith a missing/unregistered key fails without asking for a passwordE2E results (2026-08-13)
Tested against a real Clever Cloud Node app with the patched CLI (
clever-toolsPR checkout, linked as localclever).clever ssh-keys add, then:SSH_AUTH_SOCK= clever ssh -a <app> -i <good> -c 'echo SSH_OK'→
SSH_OK, exit 0SSH_AUTH_SOCK= clever ssh -a <app> -i <bad> -c 'echo SSH_OK'→ exit 255 in under 1s, no password prompt
Note: without clearing the agent, OpenSSH may still offer other loaded keys, so a wrong
-ican succeed if another registered key is available in the agent. That is normal OpenSSH behavior and unrelated to this change. For a clean negative test, useSSH_AUTH_SOCK=(orIdentitiesOnly=yeson a rawsshcall).Test app and temporary SSH key were deleted after the run.