Middle
How to determine who else is using the server besides you?
sobes.tech AI
Answer from AI
The list of users who have logged into the system can be obtained with the who command. More detailed information about current user sessions is provided by w.
who
# Output: `<username>` `<tty>` `<login_date_time>` `<ip_or_hostname>`
w
# Output: Header with current date, time, system uptime, and number of users.
# Following lines contain information about each user: user IP, terminal name, idle time, CPU active time, total CPU time used by session processes, and current command.
The command history of users can be viewed in command history files (~/.bash_history, ~/.zsh_history, etc.) for each user, if history logging is enabled.
System process logs (/var/log/auth.log, /var/log/secure, /var/log/syslog) contain information about successful and failed login attempts, user switches, and other authentication-related events. Analyzing these logs can help identify suspicious activity.
The list of running processes and their owners can be obtained using the ps aux or top commands.
ps aux
# Output: `USER`, `PID`, `%CPU`, `%MEM`, `VSZ`, `RSS`, `TTY`, `STAT`, `START`, `TIME`, `COMMAND`
# The `USER` field shows the owner of the process.
top
# An interactive process monitor with owner information.