• 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 disable timeout in ssh during login prompt (login session inactivity) in Linux

by admin

You are one of those guys who need more time while putting in the credentials during ssh logins, but due to the login session inactivity timeout, you are not able to login into the system in time.

# time ssh -l testuser server01
Password:
Connection closed by 192.168.10.10

real    2m06.000s
user    0m0.015s
sys     0m0.004s

This short note lists steps to disable the login session timeout in ssh.

Types of inactivity timeouts

There are 2 types of inactivity timeouts.

  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.

Disabling login session inactivity during ssh login

1. Please put “LoginGraceTime 0” into /etc/ssh/sshd_config.

# vi /etc/ssh/sshd_config
LoginGraceTime 0

2. Restart the ssh service for the changes to take effect.

# service sshd restart

This will disable the auto disconnection. If you do not want to disable the auto disconnect, you can increase the time for auto disconnect to a sufficiently large value. Just set the seconds after “LoginGraceTime” parameter.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Re-generate initramfs and vmlinuz for Rescue Kernel with Current Kernel in CentOS/RHEL 7
  2. Unable To Extend LVM File System with Associated Snapshot in CentOS/RHEL
  3. gzip Command Examples in Linux
  4. Basic vi commands (cheat sheet)
  5. How to remove unwanted entries in /etc/shadow file
  6. pam_tally2 command – lock & unlock ssh failed logins in linux
  7. Reducing/Limiting the CPUs in CentOS/RHEL 5,6
  8. ‘ulimit: max user processes: cannot modify limit:operation not permitted’ Shown When Login
  9. YUM command examples to install, remove and upgrade packages
  10. CentOS / RHEL : How to Recover from deleted /etc/passwd file

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright