call rsh from .NET - source code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi;

Can anyone point me at some source code for calling rsh on both Windows and
unix servers where I pass in the command & arguments and get back the
standard output & error?
 
Hi;

I thought of this but I was hoping there was a way to do it without calling
rsh on the command line as that provides one more place things can go wrong
(rsh.exe not found, command line problem, etc.)

Is there a way to do this where I just call an API?

thanks - dave
 
Hi Dave,

Based on my knowledge, rsh means remote shell similar with cmd.exe which is
a local shell.
I do not think rsh.exe's functions can be done with an API call. because it
concern about accept the user input and transfer the command to the remote
server and so on.
The rsh.exe is shipped with OS installation. It will be installed in the
system32 directory.
e.g.
<WINDOWS>\system32\rsh.exe
You may also try to access to the system directory with the environment as
below.
%windir%\system32\rsh.exe

By default the %windir%\system32\ directory is in the system search path.

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
With an API? It might be possible, but I do not know of any way. The Process
object is not the greatest methodology, necessarily, but it does allow you to
use standard in and standard out. Admitedly, it is effectively the same as
calling the command line from a command prompt (except programatically).

We use it regularly and have found the only time it causes us problems is
when the process finishes in a fraction of a second and does not leave time
to query standard out. In those situations, if the executable allows, we
write to a log and parse it. Yes, it is not an extremely sexy methodology,
but it works fairly easy, is easily maintainable and the learning curve is
not that high. The same problem could rear its ugly head through API calls,
however.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
rsh lets me pass a username but not a password. Is there any way to run the
command as a given user/pw?

thanks - dave
 
Hi;

I just realized - your example uses the GNU ssh. Two additional questions
please:
1) Where can I get that?
2) Does Windows server support ssh natively (ie does it have a ssh server)?

thanks - dave
 
Hello!
You wrote on Tue, 1 Mar 2005 10:11:05 -0800:

DT> I just realized - your example uses the GNU ssh. Two additional
DT> questions please:
DT> 1) Where can I get that?

See OpenSSH. Alternatively use SSH components
(http://www.secureblackbox.com/description-sec-sshblackbox.html) for .NET
and avoid using external software

DT> 2) Does Windows server support ssh natively (ie does it have a ssh
DT> server)?

No. OpenSSH is one of available options, and there are several commercial
SSH servers.

With best regards,
Eugene Mayevski
 
Hi;

Yep - same thing setting the user on the server side and no password from
the client. I'm guessing that ssh is user/pw and rsh is just unauthenticated
user - which seems awfully unsecure.

thanks - dave
 
Hi

Yes, I think r function is the legacy of the unix world. If you still have
any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hello!
You wrote on Wed, 2 Mar 2005 08:21:06 -0800:

DT> Yep - same thing setting the user on the server side and no password
DT> from the client. I'm guessing that ssh is user/pw and rsh is just
DT> unauthenticated user - which seems awfully unsecure.

Security in SSH is provided not by password authentication, but by strong
encryption based on asymmetric algorithms.

With best regards,
Eugene Mayevski
 
I think ssh has to be authentication as well as encryption. Just encryption
would still let anyone in - it only would stop evesdropping on a session.

??? - dave
 
Hello!
You wrote on Thu, 3 Mar 2005 06:47:08 -0800:

DT> I think ssh has to be authentication as well as encryption. Just
DT> encryption would still let anyone in - it only would stop evesdropping
DT> on a session.

Sure. However, SSH authentication is not jsut username/password. SSH
protocols support several authentication methods, most of them not using
username at all.

With best regards,
Eugene Mayevski
 
Back
Top