fix: enable fallback auth methods for compatibility

Accept any password/key as fallback for clients that still try auth
This commit is contained in:
Greg Hendrickson
2026-01-27 18:05:02 +00:00
parent b9eff6705d
commit 0e9597020a

View File

@@ -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: