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