mirror of
https://github.com/ghndrx/shellmate.git
synced 2026-02-10 14:55:08 +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:
|
def begin_auth(self, username: str) -> bool:
|
||||||
self._username = username
|
self._username = username
|
||||||
# Return False = auth complete (no auth required)
|
# Return False = auth complete immediately (no auth required)
|
||||||
# This allows instant passwordless connections
|
# This tells the SSH client that no authentication is needed
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def password_auth_supported(self) -> bool:
|
def password_auth_supported(self) -> bool:
|
||||||
# Not needed since we skip auth entirely
|
# Enable password auth as fallback - accept any/empty password
|
||||||
return False
|
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:
|
def public_key_auth_supported(self) -> bool:
|
||||||
# Not needed since we skip auth entirely
|
# Accept any public key
|
||||||
return False
|
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:
|
async def handle_client(process: asyncssh.SSHServerProcess) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user