How to disconnect idle (after few minutes of inactivity) ssh sessions automatically on Linux

#vim /etc/ssh/sshd_config
comment out these line and set time is second:
[....]
ClientAliveInterval 300  #seconds
ClientAliveCountMax 0
[....]
Note:
ClientAliveInterval – This indicates the time-out in 300 seconds. After x number of seconds, ssh server will send a message to the client asking for response. Deafult is 0. If any response received from client, the session was killed automatically.

ClientAliveCountMax – This indicates the total number of checkalive message sent by the ssh server without getting any response from the ssh client. Default is 3 but i’m going to set zero (0) to check this experiment.