Junior
How to find out about active sessions of other users on the server?
sobes.tech AI
Answer from AI
To view active sessions of other users on the server, you can use the following commands:
who: Shows who is currently logged in, where they logged in from, and when.w: Provides the same information aswho, but also shows what processes the users are running.last: Displays the login and logout history of users.finger <username>(if the service is installed): Provides information about a specific user, including their last activity./var/log/wtmp: Log file containing information about all user logins and logouts. It can be viewed using thelastcommand./var/log/auth.logor/var/log/secure(depending on the distribution): Log files containing authentication attempt information.
Usage examples:
# Show current users
who
# Show current users and their processes
w
# Show login history of all users
last
# Show information about a specific user (if finger is installed)
finger johndoe