How can I terminate the idle session in ubuntu?
I have seen there are 2 idle session are present in my ubuntu 22.04 VM. I want to terminate those sessions which is not required how can I proceed to terminate.
Log in to post an answer.
If by "idle session" you mean a logged-in user session that's sitting idle on an Ubuntu system, there are several ways to terminate it. Option 1: Log out your own graphical session From a terminal, you can end your current desktop session: gnome-session-quit --logout --no-prompt Or simply log out from the desktop environment's menu. Option 2: Terminate another user's session List logged-in users: who or loginctl list-sessions Example output: SESSION UID USER SEAT 2 1000 alice seat0 3 1001 bob Terminate a specific session: sudo loginctl terminate-session <SESSION_ID> Example: sudo loginctl terminate-session 3 Option 3: Terminate all sessions for a user sudo loginctl terminate-user username Example: sudo loginctl terminate-user bob Option 4: Kill an SSH session Find the SSH login: who Then identify the shell or SSH process: ps -u username Terminate it: sudo pkill -KILL -u username or kill a specific PID: sudo kill -9 <PID>