I am using Ubuntu, and I want to automatically log out users from the terminal if they stay inactive for some time. I know this can improve server security. The timeout should be set for all users, and I want it to be around 5 minutes (300 seconds).
How can I configure this command-line timeout for Ubuntu?