We help IT Professionals succeed at work.

Solaris automatic logoff

mkuser01
mkuser01 asked
on
3,532 Views
Last Modified: 2013-12-27
Hi,

how can I set my solaris box to automatically logoff users after 30 mins of inactivity?

mkuser01
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi Tintin,

Not working.  I put the line that you have mentioned on the /etc/profile.
CERTIFIED EXPERT
Top Expert 2007

Commented:
Hi,

Please note that setting TMOUT to automatically logout ideal users is working fine, but it has different behavior under bash and ksh. Please see the description in the following link on how bash an ksh behave.

http://open.itworld.com/5040/nls_unix_idlelogons060629/page_1.html

I tried setting TMOUT from the command prompt and it works.
CERTIFIED EXPERT
Top Expert 2007

Commented:
mkuser01.

What is the default shell of the users?
CERTIFIED EXPERT
Top Expert 2007

Commented:
Hi,

If the users login shell is

- ksh / bash, then use TMOUT=num (where num is number of seconds, this can be included in .profile .bash_profile in the user home dir) env variable to set timeout in seconds (please see previous link for ksh behavior).

If ksh / bash not the login shell, then it will simply exit that shell.

- csh / tcsh, then use

set autologout = num (where num is number of minutes, this can be included in .login of the user in his/her home dir).




Author

Commented:
Actually I have two Solaris boxes.  I am using root for this scenario.  both are using ksh.

I am just wondering, the other one is using /bin/ksh while the other one is using /usr/bin/ksh.  This are the same right?
CERTIFIED EXPERT
Top Expert 2007

Commented:
Yes, /bin/ksh and /usr/bin/ksh are the same

$ ls -ld /bin
lrwxrwxrwx   1 root     root           9 Oct  5  2005 /bin -> ./usr/bin


So what happens when you login as root and do

export TMOUT=5

Author

Commented:
To all,

My opology!!! I did have a typo error and that was causing the problem.  first suggetion from Tintin works fine.

Thanks.
CERTIFIED EXPERT
Top Expert 2007

Commented:
Hi,

If you can clarify if it is taking the exact time for ksh or it is giving additional 60 seconds as described in the link and which is happening on my system as well.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.