Skip to main content

Posts

Showing posts from January, 2015

Configure BASH, KSH, TCSH, ZSH Shell To Logout User Automatically After Idle Time

You can configure any Linux system to automatically log users out after a period of inactivity. Simply login as the root user and create a file called /etc/profile.d/autologout.sh , enter: # vi /etc/profile.d/autologout.sh Append the following code: TMOUT=300 readonly TMOUT export TMOUT Save and close the file. Set permissions: # chmod +x /etc/profile.d/autologout.sh Above script will implement a 5 minute idle time-out for the default /bin/bash shell. You can also create tcsh version as follows: # vi /etc/profile.d/autologout.csh Append the following code: set -r autologout 5 Save and close the file. Set permissions, enter: # chmod +x /etc/profile.d/autologout.csh Dealing with ssh clients SSH allows administrators to set an idle timeout interval. After this interval has passed, the idle user will be automatically logged out. Open /etc/ssh/sshd config file, enter: # vi /etc/ssh/sshd config Find ClientAliveInterval and set to 300 (5 minutes) as follows:

Using GnuPG for SSH authentication

“Using GnuPG for SSH authentication” may refer to two distinct things: making the GnuPG agent (which is normally used to cache the passphrase of your OpenPGP key) to also act as a SSH agent, to cache the passphrase of your SSH key; using a key pair of your OpenPGP keyring as a SSH key pair. In this note, I will explain how to do this in GnuPG 2.1 (“modern”).