Skip to content

Instantly share code, notes, and snippets.

@stonehippo
Last active July 5, 2017 22:38
Show Gist options
  • Save stonehippo/b95638a53bdf928be1edad9d4f16cb20 to your computer and use it in GitHub Desktop.
Save stonehippo/b95638a53bdf928be1edad9d4f16cb20 to your computer and use it in GitHub Desktop.
Useful commands

nestat -lntu

list open TCP & UDP ports

cat /dev/null > ~/.bash_history && history -cw && exit

completely erase command history and exit current shell (logout)

who && ps -dN | grep pts/ and kill -9 [pid]

see logged in sessions, find their root process ids, and kill them to force a logout

sudo iptables -L -n --line

see banned addresses with fail2ban + iptables

pu -u [username]

see services owned by a given user

sudo dpkg --list | grep [package]

Look for an installed package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment