When a server behaves strangely, the first thing I want to know is whether someone else is on it. w answers that in one screen.
It prints one line per login session: the user, the terminal, where the login came from, how long it has been idle and the command that session is running right now.
w
w -i
w alice
The header line also gives you the uptime and the load average, so you get a quick health check for free. With -i you see the IP address instead of a host name, which is handy when reverse DNS gives you something vague. Add a user name to see only that account.
What to look for: a login from an address you don’t recognise, a session that has been idle for days (someone forgot to log out, or a tmux session nobody remembers), and the WHAT column. A shell running something like a miner or an nc listener stands out fast.
One limit to keep in mind. w reads the utmp records, so it only lists sessions that registered a login. A process started by a hacked web app or a cron job never shows up here. For those you still need ps or ss. I see w as the cheap first glance, not as proof that nobody is there.
Further reading: w(1) manual page