I want to make my terminal freeze, if it is not used for more than 15 minutes. I do have the option to edit the .ssh/sshd_config.
But I want a script instead of this..
See this question for possible solutions.
If you use
screen you can press Ctrl-a x to manually lock your session. Your user password is required to unlock it again. For an automatic locking after 15 minutes (900 seconds) just specify
idle 900 lockscreen in your
There is also
vlock which doesn't require an already running screen session but has to be run manually.
Add the following lines in user's .bashrc
if [ -z "$STY" ]; then exec screen -ARR fi
Edit the file .screenrc
idle 900 lockscreen
It will lock the screen which is idle for more than 15 minutes and if you try to access it again, you will have to enter the password.