Show last logins

Show the last 20 logins with IP and session length.

last -n 20 | head -25

tool
linux133 commands
tags
linuxsecurity

More linux commands

  • journalctl -u ssh --since '24h ago' | grep 'Failed password' | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -10

    Show the top 10 IPs with failed SSH password logins in the last 24 hours.

  • sudo -l -U <username>

    List sudo rules for a specific user.

  • usermod -aG docker,sudo alice

    Add a user to several groups and keep the groups they already have.

  • cat /proc/<pid>/smaps | awk '/^Size/{sum+=$2} END{print sum/1024" MB"}'

    Show the total virtual memory size of a process from smaps, in MB.

  • grep -E 'HugePages|AnonHugePages|Transparent' /proc/meminfo

    Check whether THP and hugepages are configured and in use.

all 133 linux commands