mirror of
https://github.com/ghndrx/shellmate.git
synced 2026-02-10 06:45:02 +00:00
fix: enable fallback auth methods for compatibility
Accept any password/key as fallback for clients that still try auth
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user