From 0e9597020a178aa0c14a0f02923b5af41c7a0e73 Mon Sep 17 00:00:00 2001 From: Greg Hendrickson Date: Tue, 27 Jan 2026 18:05:02 +0000 Subject: [PATCH] fix: enable fallback auth methods for compatibility Accept any password/key as fallback for clients that still try auth --- src/shellmate/ssh/server.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/shellmate/ssh/server.py b/src/shellmate/ssh/server.py index 5143ddc..0315c4a 100644 --- a/src/shellmate/ssh/server.py +++ b/src/shellmate/ssh/server.py @@ -27,17 +27,25 @@ class ShellMateSSHServer(asyncssh.SSHServer): def begin_auth(self, username: str) -> bool: self._username = username - # Return False = auth complete (no auth required) - # This allows instant passwordless connections + # Return False = auth complete immediately (no auth required) + # This tells the SSH client that no authentication is needed return False def password_auth_supported(self) -> bool: - # Not needed since we skip auth entirely - return False + # Enable password auth as fallback - accept any/empty password + return True + + def validate_password(self, username: str, password: str) -> bool: + # Accept any password (including empty) for guest access + return True def public_key_auth_supported(self) -> bool: - # Not needed since we skip auth entirely - return False + # Accept any public key + return True + + def validate_public_key(self, username: str, key: asyncssh.SSHKey) -> bool: + # Accept any key for guest access + return True async def handle_client(process: asyncssh.SSHServerProcess) -> None: