Auditing User Keystrokes with pam_tty_audit and Linux Auditd

Relying on standard shell history (~/.bash_history) for security auditing is fundamentally flawed: users can unset HISTFILE, launch sessions inside screen/tmux, prepend commands with spaces, or delete history files before logout. To reliably monitor user commands at the kernel level, Linux provides the pam_tty_audit PAM module. This module enables TTY input logging directly through the Linux Audit daemon (auditd), capturing keystrokes before the shell receives them. Module Parameters pam_tty_audit.so supports three key arguments: ...

October 7, 2015 · 2 min · 292 words · Ahmad Mahfouz

Mastering SSH Port Forwarding: Local, Remote, and Dynamic SOCKS Proxies

SSH is far more than an encrypted remote terminal—it is an extensible transport protocol capable of encapsulating arbitrary TCP traffic across segmented network boundaries, NAT gateways, and restrictive firewalls. Here is how to leverage Dynamic, Local, and Remote Reverse SSH tunnels. 1. Dynamic Port Forwarding (-D): SOCKS Proxy Dynamic port forwarding turns your SSH client into a local SOCKS5 proxy server. Any application configured to use this proxy routes its network requests through the remote SSH host. ...

August 12, 2015 · 2 min · 306 words · Ahmad Mahfouz