Server Administration & Management

How to Auto Logout TimeSet

Ques : What is this auto logout?
Ans :  Auto logout is a concept to force user to logout from the remote server. If the open session to remote server is idle for a given time.

Ques :- So why actually we require auto logout?
Ans : As a security measure, This is good practice to set this, because its not a good idea/practice to keep open terminal idle.

Ques : How to accomplish this?
Ans : This can be achieved by two ways.

1. Open /etc/profile and append TMOUT variable. See my below example

# vi /etc/profile

add following line
Export TMOUT=600 # 10 minutes in seconds
typeset -r TMOUT

This will set time-out to 600 sec(ie 10mins) and I have given typeset -r which read-onlyand will not allow users to change this. Save the file and exit.

2. By creating /etc/profile.d/sessiontimout.sh file then keeping above mention entries in it.

# cd /etc/profile.d/

# touch sessiontimout.sh

# vi sessiontimout.sh

Export TMOUT=600 # 10 minutes in seconds
typeset -r TMOUT

Now save and exit the file, As this is a script we have to change the permissions too.

#chmod +x /etc/profile.d/sessiontimout.sh


July 21, 2011 Posted by | Unix/Linux | , , | Leave a comment