Loïc Grenié thanks!! Work well! I was trying to do a script exactly
like your script! Thanks and again thanks! 

--- Begin Message ---
    Hi,

Le mar. 21 juin 2022 à 10:14, Conti Stefano <cont...@email.it> a écrit :

> Hello! In My Debian 11 SSH timeout logoff not work! I must put in .bashrc
> of my user: TMOUT=600 to loogut after 10 minutes. Work, of course, but
> close all bash terminal!
>
> This is my sshd_config with info for timeout:
>
> TCPKeepAlive no
> ClientAliveInterval 600
> ClientAliveCountMax 0
>
> Any suggest?
>

     Maybe

if [ "$(ps -o comm $PPID | tail -1)" = sshd ]; then TMOUT=600; fi

   This is not foolproof, but it should work if you do not abuse the system.

      Hope this helps,

         Loïc

--- End Message ---

Reply via email to