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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • 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. Oracle VM Server for SPARC (Ldoms) : How to Change Primary/Control Domain’s UUID
  2. Solaris 11 (x86/64) : How to boot from DVD to single user mode
  3. Performing Network Diagnostics in Solaris 11 with “network-monitor”
  4. Solaris 11 : Setting user and group quota for ZFS datasets
  5. Understanding “Holding a ZFS Snapshot” Feature
  6. How to provide unique hostid for a non global zone
  7. How to remove a failed disk using luxadm and cfgadm
  8. How to prevent non-root user from creating crontab entry
  9. Complete hardware reference : M3000 / M4000 / M5000 / M8000 / M9000
  10. Solaris Performance troubleshooting : Disk (I/O) performance issues

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright