Is there a way to logout an inactive user after nn minutes?
Rich Braun
rbraun at spdcc.COM
Sat May 18 04:40:41 AEST 1991
fredrick at acd.uucp (Tim Fredrick) writes:
>>> In the ksh, there is an environment variable, TMOUT, ...
>I tried putting this in my own .cshrc file and I didn't get logged out ...
You've answered your own question: if you're running csh, you don't
get this feature. If you're running ksh, your .cshrc file won't be read.
Switch to ksh, in any event; it's a much better shell. It uses
.profile for startup purposes.
>And a more general question -- is there a file that will set up environment
>variables and/or aliases for any user logging in?
Yes. For csh, it's /etc/cshrc; for ksh, it's /etc/profile. The problem
with doing things this way is that users can't bypass commands in these
files, so only put >absolutely mandatory< stuff in the system-wide
startup files, to avoid creating some of the monster 2-minute logins
I've run across in some workplaces. Put optional stuff in an separate
file, which users can run by putting the line
ENV=/usr/local/lib/local-goodies.sh ; export ENV
into their own .profile script.
A question for those whose AIX and ksh knowledge surpasses my own:
is there a way for a sub-shell to export environment variables to its
parent, and/or is there a way to cause ksh to run a script in its
own context rather than within a subshell? (This is addressed via
the 'source' command in csh, but I know of no equivalent in ksh.)
For example, if I create a file called "setup" which contains the
statements
alias -x cmd=abc
VAR=def ; export VAR
I'd like to be able to run this script and have it permanently affect
my login session, the way it would affect my session if installed in
.profile.
-rich
More information about the Comp.unix.aix
mailing list