diff --git a/sys/user_cull.py b/sys/user_cull.py index 9ba936f..98ecd3a 100755 --- a/sys/user_cull.py +++ b/sys/user_cull.py @@ -106,7 +106,7 @@ for user in psutil.users(): 'timeout': timeout} fmtd_goodbye = goodbye_mesg.format(**fmt_vals) if only_ssh: - if user.pid in ssh_pids: + if psutil.Process(user.pid).ppid() in ssh_pids: if goodbye: subprocess.run(['write', user.name,