- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- ssh - idle session timeout
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2009 11:03 PM
тАО08-27-2009 11:03 PM
ssh - idle session timeout
SLES 10 SP2
# uname -r
2.6.16.60-0.21-smp
I want to disconnect those ssh clients, who are idle more then 14 mintues
On ssh server, in /etc/ssh/sshd_config
ClientAliveInterval 5
ClientAliveCountMax 3
then restart the ssh daemon.
from ssh client(another SLE 10 SP2 box), I logs on the server, and did nothing(idle) for 20 minutes, but session was valid/remain.
what I am missing, please help
Regards
Maaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2009 12:12 AM
тАО08-28-2009 12:12 AM
Re: ssh - idle session timeout
These settings have no effect if the network connection is OK and the user is just idle (or has walked away from his/her keyboard).
I assume you use the default "bash" as the standard shell for your users?
In that case, add this to your /etc/profile:
export TMOUT=840 # 14 minutes in seconds
typeset -r TMOUT
The second command makes the TMOUT variable read-only, so the users cannot disable the timeout.
Note that this timeout works only if the user has become idle when the session is at the shell prompt: if the user has started a program and then walked away, the idleness detection must happen within that program (because the OS and the shell won't know whether a program can be stopped without causing data loss).
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2009 04:57 AM
тАО08-28-2009 04:57 AM
Re: ssh - idle session timeout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2009 06:00 AM
тАО08-30-2009 06:00 AM
Re: ssh - idle session timeout
This change will not help.
TMEOUT variable in the shell will help with idle ssh sessions.
Once an application, even vi is run, TMEOUT will not help.
It is TIMEOUT in some distributions.
SEP
hpuxconsulting in yahoo messenger.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2009 10:35 PM
тАО08-30-2009 10:35 PM
Re: ssh - idle session timeout
>These settings have no effect if the network connection is OK and the user is
>just idle (or has walked away from his/her keyboard).
Thanks for explaining. But how do you find this explanation ;) ? .
>Note that this timeout works only if the user has become idle when the
>session is at the shell prompt: if the user has started a program and then
>walked away, the idleness detection must happen within that program
then whats the solution ?
actually we need to lock and/or disconnect the idle users.
we normally logs on the server via ssh, but some users also logs on via vnc.
so if a user run vi(or any other program) and left his/her seat, then TMOUT is not a solution.
so is there any good solution ?
Hi Ivan Ferreira
>For your case, probably you need to write an script to kill a process that is
>IDLE for the required time.
you mean script will first kill the processes belongs to the idle user, and
then TMOUT will automatically logout the user ? because I just dont want to
kill idle user processes, but also disconnect those users too.
>There are some scripts for doing this arround.
please share ;)
Hi Steven E. Protter, thanks for the help
Regards
Maaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2009 09:50 PM
тАО09-13-2009 09:50 PM
Re: ssh - idle session timeout
here is the solution ... following works ;-)
ClientAliveInterval 900
ClientAliveCountMax 0
Matti Kurkela
>These settings have no effect if the network
>connection is OK and the user is just idle >or
>has walked away from his/her keyboard).
Dear, the above setting will disconnect the idle session of the user... even if the network connection is OK
thanks for help
Regards
Maaz