From e2854e960c096c6dae109ccb45d99c5fb4a36ca8 Mon Sep 17 00:00:00 2001 From: "David J. Bianco" Date: Fri, 23 Aug 2024 12:41:51 -0400 Subject: [PATCH] Now log passwords for any login attempt (failures and successes). --- ssh_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssh_server.py b/ssh_server.py index 4eb030c..23f2def 100755 --- a/ssh_server.py +++ b/ssh_server.py @@ -85,7 +85,7 @@ class MySSHServer(asyncssh.SSHServer): logger.info(f"AUTH: User {username} attempting to authenticate.") return True else: - logger.info(f"AUTH: SUCCESS for user {username}.") + logger.info(f"AUTH: SUCCESS for user {username} with password ''.") return False def password_auth_supported(self) -> bool: @@ -101,10 +101,10 @@ class MySSHServer(asyncssh.SSHServer): pw = accounts.get(username, '*') if ((pw != '*') and (password == pw)): - logger.info(f"AUTH: SUCCESS for user {username}.") + logger.info(f"AUTH: SUCCESS for user {username} with password '{password}'.") return True else: - logger.info(f"AUTH: FAILED for user {username}.") + logger.info(f"AUTH: FAILED for user {username} with password '{password}'.") return False async def start_server() -> None: