LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   permission denied using rsh (security not an issue) (http://www.linuxquestions.org/questions/linux-networking-3/permission-denied-using-rsh-security-not-an-issue-431398/)

Singist 04-03-2006 01:23 PM

permission denied using rsh (security not an issue)
 
Hi all,
I am using a perl script that connects to hosts on a local network to monitor host activity. It uses rsh to connect to each host which in turn runs several commands. However i am getting permission denied when trying to connect even though .rhosts file on each host is set up to allow all hosts, and hosts.equiv file also set up correctly.

the code that rsh's is as follows

foreach $host (@hosts) {


print FH "<H3><A NAME\=\"$host\">$host\</A\></H3>";
print FH "<P>";

$cmd="hostname && vmstat && top -n 1 | head -n 20 && df -k";

foreach $host (@hosts) {

print FH "<TABLE BORDER=0>";

@result=`rsh $host -l root -K $cmd`;

foreach $line (@result) {

if ( $line =~/9[0-9]\%\s*\>\// ) {

$count++;

print FH "<TR><TD> <A NAME\=\"$count\"><FONT COLOR\=\"RED\"\>$line</FONT\></A></TD></TR>";

@hosts is an array that holds all the hostnames on the network. To say im almost pulling my hair out at this stage is an understatement. Any help would be appreciated. i did get something to work at one stage but it only ran the commands on the machine that the perl script is running from. this script displays all the results from each machine in a web browser btw.

cheers in advance, Singist

centauricw 04-04-2006 02:22 PM

Have you made sure that the rsh services are enabled in the inetd/xinetd conf? Most Linux systems ship with these services disabled by default.


All times are GMT -5. The time now is 06:53 AM.