1830143 Members
26815 Online
109999 Solutions
New Discussion

Re: rsh hanging

 
B.O
Occasional Contributor

rsh hanging

Hello all, a lot of my scripts hang because you cannot rlogin into these systems. The script says ping systemA, if pingable, then rsh systemA w etc.
These systems are pingable, but you cannot rsh into them. It's often resolved after a reboot. What can i check pls or how can i include in the script to termintate if rsh hanging?
Thanks.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: rsh hanging

Shalom,

On the target system:
tail -f /var/log/messages

run your script.

If that yields no data, try using tdpdump

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
skt_skt
Honored Contributor

Re: rsh hanging

I would recommend ssh instaed.More secure. Still we need to identify why the rsh hangs.
B.O
Occasional Contributor

Re: rsh hanging

Thanks. I'm using rsh because the scripts need to run some commands on several of linux systems: rsh systemA uptime; rsh systemA ls - al xxxx etc. These scripts are run from the crontab.
Moreover, ssh will require root password, hence only good during interactive sessions.
I just need to know if there's something to include in the script for the rsh to terminate rather than hang.
Thank you.
skt_skt
Honored Contributor

Re: rsh hanging

password less ssh can be set up too.

Login with "applmgr"(example) account and check if you have these files -
/home/applmgr/.ssh/id_rsa
/home/applmgr/.ssh/id_rsa.pub

If not then run;

ssh-keygen -t rsa

example -
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/sharma/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/sharma/.ssh/id_rsa.
Your public key has been saved in /home/sharma/.ssh/id_rsa.pub.
The key fingerprint is:
c1:a8:1d:f8:e5:a4:79:10:d3:5c:d8:90:72:0d:f0:84 sharma@hostname

Now copy the contents of source "/home/applmgr/.ssh/id_rsa.pub" to dest "/home/applmgr/.ssh/authorized_keys". Append in case the authorized file already exists on dest

P.S - The public/private key pair needs to be generated only once via ssh-keygen and thereafter same keys can be copied to "authorized_keys" on diff. servers for passwordless entry.




B.O
Occasional Contributor

Re: rsh hanging

Thanks, i'll try it out. But i doubt that's what i need because i need to run these scripts as root, and not as myself.
Thanks.
skt_skt
Honored Contributor

Re: rsh hanging

similar ssh relation can be mase for all acconts including root