- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- readonly environment variables in csh?
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
Forums
Discussions
Discussions
Discussions
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
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
01-28-2005 02:08 AM
01-28-2005 02:08 AM
readonly environment variables in csh?
TMOUT=3600
readonly TMOUT
export TMOUT
This will prevent users from changing their TMOUT value, and automatically log them out after 1 hour of inactivity.
The csh equivalent of TMOUT is autologout, but is there a way to make it readonly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 02:52 AM
01-28-2005 02:52 AM
Re: readonly environment variables in csh?
It totally ignored the TMOUT value I have in /etc/profile
Further it ignored my attempts to set it manually.
You may wish to try and set it in the .csh equivalent of .profile.
This probably won't work either.
Note also that TMOUT will not log users out that have an app running. Even something as simple as top will let the user remain logged on indefinitely.
SEP
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
01-28-2005 03:09 AM
01-28-2005 03:09 AM
Re: readonly environment variables in csh?
For csh, i think this should work.
Disable autologout,
# set autologout=0
unset the value set for autologout.
# unset autologout
To set the value to 60 minutes,
#set autologout=60
this i what i find.
/Quote/
With C shell (csh), the autologout variable is set to 60 minutes by default. To disable it, you must explicitly unset the variable or set it to 0. Modify /etc/csh.login to change this on a system-wide basis, or modify .cshrc in the user's home directory. autologout must be specified in all lower-case characters.
/EndQuote/
hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 03:15 AM
01-28-2005 03:15 AM
Re: readonly environment variables in csh?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 04:14 AM
01-28-2005 04:14 AM
Re: readonly environment variables in csh?
chsh user_name /usr/bin/sh
Now both the readonly attribute and the TMOUT variable will work reliably, and you'll gain access to the world of POSIX shells. For reference:
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
8-)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 04:30 AM
01-28-2005 04:30 AM
Re: readonly environment variables in csh?
6 points to Bill for making me laugh!:o)
I haven't used csh since I discovered ksh, nor would I go back to it. Unfortunately, I administer systems with lusers who DO use csh, and I want to prevent them from leaving themselves logged in all night/weekend (Not that I have anything against our office cleaners, but I don't want them fiddling with anything if temptation is left in their way).
If I put the line:
setenv autologout 60
in
/etc/csh.login
then it should automatically logout any idle C shells with no child processes after 60 minutes.
BUT, there's nothing to stop the csh lusers from typing:
setenv autologout 0
or
unset autologout
when they get fed up with having to login again every morning.
I want to stop them from changing the value of autologout.
Unfortunately, re-education on the joys of POSIX/ksh is likely to be resisted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2005 05:21 AM
01-28-2005 05:21 AM
Re: readonly environment variables in csh?
One way to track down truly idle users is the who -u command where the 4th field (right after the date) is the tty or terminal activity. It will contain 3 possible values:
. = currently active during the last minute
old = no keyboard activity in more than 24 hours
hh:mm = hours:minutes since last keyboard activity
So kill anyone that has "old" in the activity field. Oh, unless they are running a program that takes 30 hours to complete and the program wasn't put into the background (or other similar situations).
As you can see, we sysadmins end up trying to solve behavioral problems with social engineering like forcing lazy users to log off and there will always be exceptions...
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2005 08:51 PM
01-30-2005 08:51 PM
Re: readonly environment variables in csh?
Oh, well. Thanks for your replies.