HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Terminate idle login
Operating System - Linux
1830624
Members
2131
Online
110015
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
02-11-2004 06:46 PM
02-11-2004 06:46 PM
Terminate idle login
Our HP UX system limited the no. of user login , could suggest how to terminate the idle login ( eg. 2 hours ) ? could anyone post the script for reference ? Thx.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2004 06:49 PM
02-11-2004 06:49 PM
Re: Terminate idle login
In the users .profile or in /etc/profile add
"export TMOUT=xxxx" where xxxx is the number of seconds that user can remain idle without being logged out.
"export TMOUT=xxxx" where xxxx is the number of seconds that user can remain idle without being logged out.
Never preceed any demonstration with anything more predictive than "watch this"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2004 12:13 AM
02-12-2004 12:13 AM
Re: Terminate idle login
Or use the w command, grep the idle timeouts of more then 2 hours. This will lead to the tty being used. Then you can kill all processes running on that tty.
w | awk '$4 ~ /[2-9]:[0-9]*/ {print $2}
$4 ~ /[0-9][0-9][0-9]*:[0-9]*/ {print $2}'
This will give the ttys with idle times of at least 2 hours.
Now you can use ps -t to get processes running there and kill those... Or just: fuser -k /dev/ should do the trick.
w | awk '$4 ~ /[2-9]:[0-9]*/ {print $2}
$4 ~ /[0-9][0-9][0-9]*:[0-9]*/ {print $2}'
This will give the ttys with idle times of at least 2 hours.
Now you can use ps -t
Every problem has at least one solution. Only some solutions are harder to find.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP