Skip to content

fix(ssh): forbid password authentication fallback - #1120

Open
mehdi653 wants to merge 1 commit into
CleverCloud:masterfrom
mehdi653:fix/ssh-forbid-password-fallback
Open

fix(ssh): forbid password authentication fallback#1120
mehdi653 wants to merge 1 commit into
CleverCloud:masterfrom
mehdi653:fix/ssh-forbid-password-fallback

Conversation

@mehdi653

@mehdi653 mehdi653 commented Aug 12, 2026

Copy link
Copy Markdown

Summary

Clever Cloud SSH only accepts key authentication. When a key is missing or not registered, clever ssh used 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=publickey
  • PasswordAuthentication=no

Test plan

  • clever ssh with a valid key still connects
  • clever ssh with a missing/unregistered key fails without asking for a password

E2E results (2026-08-13)

Tested against a real Clever Cloud Node app with the patched CLI (clever-tools PR checkout, linked as local clever).

  1. Valid dedicated ed25519 key registered via clever ssh-keys add, then:
    SSH_AUTH_SOCK= clever ssh -a <app> -i <good> -c 'echo SSH_OK'
    SSH_OK, exit 0
  2. Unregistered key, same setup with agent disabled:
    SSH_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 -i can 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, use SSH_AUTH_SOCK= (or IdentitiesOnly=yes on a raw ssh call).

Test app and temporary SSH key were deleted after the run.

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
mehdi653 requested a review from a team as a code owner August 12, 2026 22:05
@mehdi653
mehdi653 force-pushed the fix/ssh-forbid-password-fallback branch from 5d04236 to 0c6ac92 Compare August 12, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forbid SSH password fallback

1 participant