• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to set inactivity timeouts for logins and shells in Solaris

By admin

Types of inactivity timeouts in Solaris

There are 2 types of inactivity timeouts in Solaris.

  1. login session inactivity: This is before you log in and you are at the Login: prompt.
  2. shell session inactivity: This is after you login and the session is left unattended. This applies to only bash and ksh shells.

How to avoid Inactivity Timeout in Solaris

We will discuss here both types of inactivity timeouts and how you can extend them as per your needs.

1. Login session inactivity timeouts

Find the entry in the /etc/default/login file which defines the login inactivity details.

# TIMEOUT sets the number of seconds (between 0 and 900) to wait before
# abandoning a login session.
#
#TIMEOUT=300

The patameter TIMEOUT defines the number of seconds the login process will wait on an attempted login for a response to the login prompt. For example, if you have the TIMEOUT value set to 120, then when you “telnet”, you will have 120 seconds, or 2 minutes, to enter a login name before it closes the connection.

The default is 300 seconds, or 5 minutes.

2. The shell session inactivity timeouts

Applies only to Korn and Bash shells – /usr/bin/ksh and /usr/bin/bash

The TMOUT environment variable is what controls Korn and Bash shell inactivity timeout. If it is unset, or has a value of 0, then timeout is disabled. If it is set to a value greater than zero, then the shell will terminate if a command is not entered in the specified number of seconds in the TMOUT variable.

The TMOUT variable can be set in /etc/profile for all users, or in an individual’s $HOME/.profile file.

Note: There is no TMOUT equivalent for either the bourne (/bin/sh) or C (/bin/csh) shells. Also, it only works for login sessions which use simple shells (like telnet or rlogin). It will NOT automatically logout from a CDE or Openwindows session. However, if the TMOUT variable is set in /etc/profile as shown above, any terminal window within CDE will exit after exceeding the TMOUT idle value. That might not be a desirable thing.

Filed Under: Solaris

Some more articles you might also be interested in …

  1. How to mount the zfs rpool while booted from CD [SPARC]
  2. 12 iostat examples for Solaris performance troubleshooting
  3. The ultimate Solaris networking interview questions
  4. How to remove a failed disk using luxadm and cfgadm
  5. Solaris Volume Manager (SVM) : Understanding metadb Flags
  6. How to make telnet listen to a different port in Solaris
  7. Solaris ZFS : How to replace a failed disk in rpool (x86)
  8. Solaris Volume Manager (SVM) : How to Use Mirrors to Roll Back System Changes
  9. Solaris 11 (x86/64) : How to boot from DVD to single user mode
  10. Solaris Resource Manager Basics : Understanding Resource Pools

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary