HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: //var/opt/OV/bin/instrumentation/dormant-accounts-get.sh
#!/bin/bash

# Autor: Rossini, Hernan
# Sector: Operaciones, Datacenter, Av del Campo 1301, Artigas, Argentina.
# Fecha: 2016/05/10

# Minimo de dias.
DAYS_MIN=60

# Usuarios a excluir.
USERS_EXCLUDE='^abrt |^adm |^apache |^arpwatch |^avahi |^avahi-autoipd |^bin |^daemon |^dbus |^dovecot |^dovenull |^ftp |^games |^gdm |^gopher |^haldaemon |^halt |^hpsmh |^lp |^luci |^mail |^mailman |^mailnull |^netdump |^news |^nfsnobody |^nobody |^nscd |^ntp |^oms |^opc_op |^operator |^oprofile |^pcap |^postfix |^pulse |^ricci |^root |^rpc |^rpcuser |^rpm |^rtkit |^sabayon |^saslauth |^shutdown |^smmsp |^sshd |^stap-server |^sync |^tcpdump |^tss |^uucp |^uuidd |^vcsa |^xfs |^xguest'

# Obtengo la lista de dormant accounts.
lastlog --before $DAYS_MIN | grep -v 'Username.*Port.*From.*Latest' | grep -vE "$USERS_EXCLUDE" | sort