From b9eff6705dbd9b430a249271550fe17d3f9d6309 Mon Sep 17 00:00:00 2001 From: Greg Hendrickson Date: Tue, 27 Jan 2026 18:01:48 +0000 Subject: [PATCH] fix: enable zero-auth SSH connections - Return False from begin_auth to skip authentication - Users can connect instantly without password/key prompts - Frictionless: just ssh play@shellmate.sh --- src/shellmate/ssh/server.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/shellmate/ssh/server.py b/src/shellmate/ssh/server.py index ccf22ca..5143ddc 100644 --- a/src/shellmate/ssh/server.py +++ b/src/shellmate/ssh/server.py @@ -27,23 +27,17 @@ class ShellMateSSHServer(asyncssh.SSHServer): def begin_auth(self, username: str) -> bool: self._username = username - # Allow all usernames, we'll handle auth in the app - return True + # Return False = auth complete (no auth required) + # This allows instant passwordless connections + return False def password_auth_supported(self) -> bool: - return True - - def validate_password(self, username: str, password: str) -> bool: - # Guest access - accept any password or empty - # For registered users, validate against database - return True # TODO: Implement proper auth + # Not needed since we skip auth entirely + return False def public_key_auth_supported(self) -> bool: - return True - - def validate_public_key(self, username: str, key: asyncssh.SSHKey) -> bool: - # Accept any public key for now - return True # TODO: Implement key-based auth + # Not needed since we skip auth entirely + return False async def handle_client(process: asyncssh.SSHServerProcess) -> None: