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: