Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to replace rexec by using ssh?

Reply
Thread Tools Display Modes

How to replace rexec by using ssh?

 
 
Xumin.Lucky@gmail.com
Guest
Posts: n/a

 
      06-02-2006, 11:33 PM
Hi, everybody:

I got a problem when I try to use ssh instead of using rexec() function
in my code.

Previously, my code contains fd=rexec(&hostname,port, ....) to remotely
start the program in other machines. However, rexec is not allowed in
the new cluster (it seems all the linux clusters do not allow
r..command now). I have to use ssh instead.

Since I need to use the information of fd for the following
communication. But ssh does not return such information. So I fork the
processes as:
First, a socket is created

Then, the child process keep listening. The father process use
system("ssh....") to remote start that node.

It does not work well. The error shows that these two machine do not
communicate in a nice way.
Is there any wrong with my idea? I cann't find the source code of rexec
and don't know their work principle. What is the exactly difference
between rexec and ssh(ignoring their security mechanism)? Great thanks

Xumin

 
Reply With Quote
 
 
 
 
Andrew Gideon
Guest
Posts: n/a

 
      06-04-2006, 03:07 AM
On Fri, 02 Jun 2006 16:33:46 -0700, Xumin.Lucky wrote:

> Then, the child process keep listening. The father process use
> system("ssh....") to remote start that node.


First, you should look for a library in your chosen language (C?) which
would do what you need. I recently came across one for Perl (no, it
doesn't fork() off processes), as it happens. There may very well be one
for your language too.

What about: http://netsieben.com/products/sshlib/specs.phtml

Or: http://freshmeat.net/projects/libssh/

Alternatively, if I were doing what you appear to be doing I'd have the
child process providing the SSH behavior. Since you can have the
information flowing whichever way you want, I don't suppose this is too
important. But I think it would mean less change for your code. The
child process, and a couple of pipe()s, provides you with descriptors into
and out from the SSH process that your parent process can use similarly
the descriptors from the rexec() call.

It should be workable.

You wrote:

> The error shows that these two machine do not
> communicate in a nice way.


but don't explain what you mean by that.

- Andrew

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running rexec on Windows XP to connect to Linux vicky7909@rediffmail.com Linux Networking 2 01-21-2007 03:52 AM
Replace old box with new with same name and IP Cheryl Mutschler Windows Networking 0 08-22-2004 01:22 PM
How to replace NIC P. Schulz Windows Networking 1 07-20-2004 01:27 PM
REXEC or RSH problem Henrik J Linux Networking 1 04-21-2004 03:05 PM
rexec on windows from linux ... Eoin Verling Linux Networking 3 02-16-2004 10:33 PM



1 2 3 4 5 6 7 8 9 10 11