Cannot Get TMOUT (autologout) To Work For User Root

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Cannot Get TMOUT (autologout) To Work For User Root
# 1  
Old 03-21-2011
Cannot Get TMOUT (autologout) To Work For User Root

I am running Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

I am required to set the TMOUT variable for the root user so that root
will be logged out automatically, after 5 minutes of inactivity.

I have inserted the following into both /.bash_profile as well as the /.profile for root user:

export TIMEOUT=300

I then exited the shell and then logged back in. After no activity for
300 seconds (5 mins), I find that I am still logged in as root.

What am I doing wrong? Thanks in advance!

Cheers,

Rob S.
# 2  
Old 03-21-2011
TMOUT has to be readonly:

Code:
readonly TMOUT=300
export TMOUT

# 3  
Old 03-21-2011
Thank Jim. You were right on target!

All the best,

Rob
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Su to another user from root doesn't work within shell script

Hello I have a shell script that is run as root. Script rins ok until the point where it have to switch to user "mqm" to run other commands. It just hangs at the point of this line in the script su - mqm -c "dspmq" I ran the same commands at the terminal and they run fine. Any thoughts. (6 Replies)
Discussion started by: mo12
6 Replies

2. Red Hat

Usermod doesn't work on root

Hi, I am root user. I need to add more groups to the account. I usse the below command but no apparent result # id uid=0(root) gid=0(root) groups=0(root) # usermod -a -G 302,301,303 root # id uid=0(root) gid=0(root) groups=0(root) # What can be the reason? (6 Replies)
Discussion started by: BearCheese
6 Replies

3. Shell Programming and Scripting

TMOUT session

Hi guys, I need to set timeout for my sscript. I used TMOUT=30 at the begining of the script.I am having many read statements in my prog. So once the timeout occurs i get into next read statement if 30 secs over then coming to next read statement. But my requirement is i need to come out... (4 Replies)
Discussion started by: mohanalakshmi
4 Replies

4. Shell Programming and Scripting

How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal. I want to give some users a root level access. Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way Regards ADI (4 Replies)
Discussion started by: adisky123
4 Replies

5. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

6. Red Hat

sendmail doesn't work for root

I've created a Perl daemon that needs to send an email when an error/shutdown occurs. I use the Perl Email::Valid module and that uses sendmail. When I run the script as a regular user, the email is sent with no issues. When I run the script as the root user, I get the following message in... (1 Reply)
Discussion started by: OldManEd
1 Replies

7. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

8. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

9. What is on Your Mind?

How Many Computers Do You Have Root Access At Work?

Here we go again :D At work, where ever that is, on how many computers/servers/workstations do you have root access? Only count unix or linux boxes, thanks (no mainframes, windows or older macs, etc). (34 Replies)
Discussion started by: Neo
34 Replies

10. AIX

Tmout

I have the problem on the setting as I want to set all users to have TMOUT=600 and I set the value in /etc/profile. But certain users I don't want to have the TMOUT limitation. How should I set it? (2 Replies)
Discussion started by: kwliew999
2 Replies
Login or Register to Ask a Question