Using 'rsh' in a C++ programm

Using 'rsh' in a C++ programm

Post by Joachim Plaettner-Hochwart » Fri, 08 Jan 1999 04:00:00



Hi,
I'd like to start a process on another machine within our network out of
a C++ program. In a shell I can use the 'rsh' command to achieve that,
but what do I have to do if I wanna do that by using a C++ program? I
know that there's a 'rexec' command which I've tried but that's awkward
since it requires the password. Nevertheless I tried it but it doesn't
work. I get no error message but nothings happening either.
Can anybody help me with a little example program?

Thanks...

Joachim

-----------------------------------------------------------------------

-----------------------------------------------------------------------

 
 
 

Using 'rsh' in a C++ programm

Post by David N. Lombar » Sun, 17 Jan 1999 04:00:00



Quote:>Hi,
>I'd like to start a process on another machine within our network out of
>a C++ program. In a shell I can use the 'rsh' command to achieve that,
>but what do I have to do if I wanna do that by using a C++ program? I
>know that there's a 'rexec' command which I've tried but that's awkward
>since it requires the password. Nevertheless I tried it but it doesn't
>work. I get no error message but nothings happening either.
>Can anybody help me with a little example program?

rexec() is OK, but, as you say, the password is a pain.

I've found rsh (or remsh) to be *extremely* portable.  You may be able to
get away with popen() for simple cases; use
pipe/fork/exec/dup/select/read/waitpid when more control is needed.

By extremely portable, I mean AIX, ConvexOS, Digital UNIX, HI-OSF/1-MJ,
HP-UX, Linux, IRIX, IRIX64, Solaris, SPP-UX, SunOS, SuperUX, UNICOS, and
UXP/V.

To develop the code, forget the rsh and just try to run the target script on
the local machine.  When that works, add the rsh/remsh to the exec() and
you're in business.

---
David N. Lombard

 
 
 

1. URGENT: lost 'rsh', 'smb', and 'cd ~'

I have, in a matter of twenty minutes, lost the ability to 'cd' to my home
directory, no matter what user I'm logged in as. Also, I lost 'rsh' and all
Samba access. I have no idea what's going on! The only thing I did was
change settings for one user in Linuxconf.

I have 'xhost +hostname' for every host that needs to use rexec. Plus, I
have a .rhosts file in my user directory with all hosts I might start a
remote X session from. When I log in on SSH or at the command line, I get
"bash: /home/user/.bashrc: Permission denied", but I can still log in. I
can't 'cd' to the home directory, but I can 'cd' to any other directory
owned by that user.

I use rsh to login from XWin32. That quit working. I use Samba to map Linux
home directories on my Win98 box. That quit working.

I'm LOST! Please help!

Dean.
--
morpheus [at] directlink [dot] net
http://www.Apt7.com

2. Problems with csh and new libc...

3. What's 'side effects' of Ksh built-ins?

4. Linux and Matrox G100

5. How can I programm my own 'cd' programm in C ? (emulate shell's 'cd')

6. RAD Tools

7. Using `rsh' in a `twm' pop-up menu

8. FAQ: comp.lang.awk: pointer

9. Looking for 'Rsh' or 'tsh'

10. Can ISP detect when dial-ins are 'overloaded' ?

11. how do 'plug-ins' work?

12. Can ISP detect when dial-ins are 'overloaded' ?

13. Plug-Ins using C++