mirror of
https://github.com/ghndrx/shellmate.git
synced 2026-02-10 14:55:08 +00:00
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
This commit is contained in:
@@ -27,23 +27,17 @@ class ShellMateSSHServer(asyncssh.SSHServer):
|
|||||||
|
|
||||||
def begin_auth(self, username: str) -> bool:
|
def begin_auth(self, username: str) -> bool:
|
||||||
self._username = username
|
self._username = username
|
||||||
# Allow all usernames, we'll handle auth in the app
|
# Return False = auth complete (no auth required)
|
||||||
return True
|
# This allows instant passwordless connections
|
||||||
|
return False
|
||||||
|
|
||||||
def password_auth_supported(self) -> bool:
|
def password_auth_supported(self) -> bool:
|
||||||
return True
|
# Not needed since we skip auth entirely
|
||||||
|
return False
|
||||||
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
|
|
||||||
|
|
||||||
def public_key_auth_supported(self) -> bool:
|
def public_key_auth_supported(self) -> bool:
|
||||||
return True
|
# Not needed since we skip auth entirely
|
||||||
|
return False
|
||||||
def validate_public_key(self, username: str, key: asyncssh.SSHKey) -> bool:
|
|
||||||
# Accept any public key for now
|
|
||||||
return True # TODO: Implement key-based auth
|
|
||||||
|
|
||||||
|
|
||||||
async def handle_client(process: asyncssh.SSHServerProcess) -> None:
|
async def handle_client(process: asyncssh.SSHServerProcess) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user