help rsh killer


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help rsh killer
# 1  
Old 04-22-2008
help rsh killer

hi everyone , i have a rsh problem , some of the users letf a lot of rsh sesions opened , i need a script that chek with a "ps -fea | grep rsh" and kill every sesion that not start today . for example
Code:
    root 26770 26767  0   Apr 17 ?        0:00 rsh c-108 find / -type d -mtime +1 -name ???-??-????.??.??
    root  8803  8802  0 19:38:45 ?        0:00 rsh c-108 find / -type d -mtime +1 -name ???-??-????.??.??
    root 17009  1950  0 09:36:27 ?        0:00 in.rshd
    root 29836 29835  0   Apr 20 ?        0:00 rsh c-108 find / -type d -mtime +1 -name ???-??-????.??.??
    root 14475  1950  0 09:34:22 ?        0:00 in.rshd
    root  6801  6790  0 09:27:59 pts/40   0:00 rsh suxro001 xterm -display 10.2.47.136:0 -T suxro001
    root  8146  7394  0   Apr 19 ?        0:00 rsh sliro298 /aplicaciones/pproduccion_v3/lanza_pase_v3.sh stop

i already do , but manual can anyone help me with that

pd: sorry for my english

Last edited by Yogesh Sawant; 04-22-2008 at 04:58 AM.. Reason: added code tags
# 2  
Old 04-22-2008
Hi,
You may check for this timeoutabout shell autlogout after a given amount of inactivity time
# 3  
Old 04-22-2008
Something like this?

Code:
ps -options | awk '$5 == "Apr" { print $2 }' | xargs echo kill

I put in the "echo" for debugging; once you have verified that it does what you want, take it out.
# 4  
Old 04-23-2008
thanks man , that work perfect
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Linux

RSH

Hi All, Whenever we are giving rsh localhost date , it give an error "Permission Denied". RHEL 6 is the version, and we're logging in as "root". in .rhosts file I have mentioned all the details, and enabled rsh,rsync,rexec,rlogin in /etc/xinetd.d/ file Please suggest. Reg, Muzaffar (7 Replies)
Discussion started by: muzaffar.k
7 Replies

2. UNIX for Advanced & Expert Users

OOM KIller INVOKE

Hi I have written a code that will exhaust the memory completely by allocating it and not freeing it. The OOM killer as expected in invoked and it killed a few high memory using processes and their childs. But after that, though the system is not getting hung, it is not printing any msgs in... (3 Replies)
Discussion started by: subratasaharia
3 Replies

3. Red Hat

Rsh

Hi, I issue : rsh ****.16.0.151 -l root ls -l /tmp and I receive : connect to address ***.16.0.151: Connection refused Trying krb4 rsh... In hosts file of remote (***.16.0.151) I have : ***.16.0.202 root Can you help me ? Thank you. (0 Replies)
Discussion started by: big123456
0 Replies

4. UNIX for Advanced & Expert Users

Rsh

Hi All, I want to execute a command from my Windows machine to Linux machine using RSH only d:> rsh <Linux machine add> -l <user_name> pwd>dir in linux machine users home directory in .rhosts file I entered the windows machine IP address and user name. In linux etc/hosts.equiv file I... (1 Reply)
Discussion started by: sarwan
1 Replies

5. Linux

Help in RSH

Hi All, I want to execute a command from my Windows machine to Linux machine. d:> rsh <Linux machine add> -l <user_name> pwd>dir in linux machine users home directory in .rhosts file I entered the windows machine IP address and user name. In linux etc/hosts.equiv file I entered the... (1 Reply)
Discussion started by: sarwan
1 Replies

6. UNIX for Advanced & Expert Users

where is rsh

Hi, when a user use rsh command (or any other) , where is the executable used by him ? Many thanks in advance. (1 Reply)
Discussion started by: big123456
1 Replies
Login or Register to Ask a Question