Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Where to get rshsvc.exe service from

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> Where to get rshsvc.exe service from Page: [1]
Login
Message << Older Topic   Newer Topic >>
Where to get rshsvc.exe service from - May 18, '06, 3:04:19 AM   
bdavison

 

Posts: 15
Joined: May 18, '06,
Status: offline
I've have a Windows 2003 R2 box and want to use the rshsvc.exe instead of the Internix version as I need to call Windows commands like cmd.exe /c "blah"

In this thread it that the programs are missing but doesn't mention how to get them installed.

Any help would be greatly appreciated.
Post #: 1
RE: Where to get rshsvc.exe service from - May 18, '06, 6:02:12 AM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
That thread was dealing with "Interix components" of SFU.
The "rshsvc.exe" in SFU is in another component group with SFU.
The Win32 rsh server is thus EOL in SFU. It didn't make it into as
part of the Windows OS distribution as most of SFU did. I don't know if
it's been orphaned, but you can still get a version from the Winows 2000
resource kit.

From any of the Interix remote connection methods (rsh, telnet, ssh, ...) you
can run cmd.exe /c "blah" and get it to run.
In fact there is are several special scripts already done that wrap around this
as a basis: dir, cacls, net, etc.

(in reply to bdavison)
Post #: 2
If rshsvc.exe is EOL then how do I use the Interix serv... - May 18, '06, 8:55:37 PM   
bdavison

 

Posts: 15
Joined: May 18, '06,
Status: offline
I see that said in a couple of other threads but how exactly do you do it?
I'm a UNIX person and this whole unUNIXish environment that is somewhere in between UNIX and Windows is very foreign to me.

My setup is this.
C:/WINDOWS/SUA/etc/inetd.conf contains
shell stream tcp nowait NULL /usr/sbin/in.rshd in.rshd -a
uncommenting this line is the only change to the file.

The home directory for the user contains a standard .rhosts setup and the connections work fine with no password required as can be see from the following command.
user@UNIXHOST>rsh w2k3r2 'id'
uid=1086271(user) gid=1049089(Domain Users) groups=1049089(Domain Users), 65792(+Everyone), 197617(w2k3r2+Debugger Users), 131616(+Administrators), 131617(+Users), 66820(+INTERACTIVE), 66827(+Authenticated Users), 66831(+This Organization), 4095(CurrentSession), 1086189(somegroup)
user@UNIXHOST>

So why is the following command failing?
user@UNIXHOST>rsh w2k3r2 '/usr/contrib/win32/bin/cmd /c "dir"'
/usr/contrib/win32/bin/cmd[109]: /dev/fs/C/WINDOWS/system32/cmd.exe: No such device
user@UNIXHOST>rsh w2k3r2 '/usr/contrib/win32/bin/cmd -c "dir"'
/usr/contrib/win32/bin/cmd[109]: /dev/fs/C/WINDOWS/system32/cmd.exe: No such device
user@UNIXHOST>rsh w2k3r2 '/usr/contrib/win32/bin/cmd "dir"'
/usr/contrib/win32/bin/cmd[109]: /dev/fs/C/WINDOWS/system32/cmd.exe: No such device

What do I need to do to get it to work?

< Message edited by bdavison -- May 18, '06, 10:58:11 PM >

(in reply to Rodney)
Post #: 3
Is this the correct Interix method? - May 18, '06, 11:48:49 PM   
bdavison

 

Posts: 15
Joined: May 18, '06,
Status: offline
After reading this thread is this the correct Interix way to run a command through rshd?

user@UNIXHOST>rsh w2k3r2 'echo "dir C:\\" | /usr/contrib/win32/bin/cmd 1>&2'

This seems to work okay for my purposes and sends the STDOUT to STDERR which is sent back to the user on the remote host.
The implementation seems to me to be a rather odd way of arranging the filehandle redirection but it works.

Do you know if this will be changing in the future to follow the stanard approach?

Thanks,
Bernie.

(in reply to bdavison)
Post #: 4
RE: Is this the correct Interix method? - May 19, '06, 12:44:54 AM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
To answer your first question about "no such device":
Win32 programs can't handle output going to a socket or a pseudo-terminal(pty).
They try and find a console, but there is one (no such device).
The output needs to be filtered or directed so that the Win32 program gets file handles
for it's input/output that it recogized as valid.

There is /usr/contrib/win32/dir as a script. You can create a script for anything you do regularly of course.

What do you mean by "standard approach"?

(in reply to bdavison)
Post #: 5
RE: Is this the correct Interix method? - May 19, '06, 1:00:06 AM   
bdavison

 

Posts: 15
Joined: May 18, '06,
Status: offline
by standard approach I mean sending STDOUT back to the rsh client connection.

So that you could just do
user@UNIXHOST>rsh w2k3r2 'echo "dir C:\\" | /usr/contrib/win32/bin/cmd'
and get the data back to the client without getting errors instead having to do
user@UNIXHOST>rsh w2k3r2 'echo "dir C:\\" | /usr/contrib/win32/bin/cmd 1>&2'
and then having to somehow workout where the data is coming from. (STDOUT or STDERR)

(in reply to Rodney)
Post #: 6
RE: Is this the correct Interix method? - May 19, '06, 1:21:53 AM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Stdout does go back across the connection. The Win32 program running doesn't handle it
because it can't deal with pty's. The Unix/Interix programs do.
The redirection you are using is the "magic" that stops the Win32 program from being upset
about the input and output handles it is presented.

You could have also done "echo dir C:\\ | /usr/contrib/win32/bin/cmd | cat".
(The subtle change in quotes seem to work better for me) BTW).
The redirects & pipes are all to make the Win32 program comfortable.

(in reply to bdavison)
Post #: 7
RE: Is this the correct Interix method? - May 19, '06, 1:29:02 AM   
bdavison

 

Posts: 15
Joined: May 18, '06,
Status: offline
Okay I think I get it now.
Thanks,

The short of it is though that if you want to run complex commands it's best to write a script that does it all for you and have that located on the machine in question right?

Do you see the Interix going the same way as SFU in the next release? i.e EOL.

It would be really nice if there was a program put in place that was a standard way of doing things and it was left in place.
It just seems that every release reinvents the wheel and we have to redesign everything that uses it due to the change.

If Interix is going to go the way of SFU what should I be using so I don't have to redesign everything next time?

Thanks for your help.

(in reply to Rodney)
Post #: 8
RE: Is this the correct Interix method? - May 19, '06, 2:58:59 AM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Most of the components in SFU (Interix, NFS client, NFS server, UNM, ...) are now
part of the base OS distribution. They aren't going EOL.
Interix 5.2 is part of W2K3. Interix 6.0 will be in Vista (in dev now).
Each version gets a little more system functionality than the previous.
The most recent Interix subsystem hot fix allows for better CMD.EXE interaction.
So if you haven't already got this it would likely be worth it for you.
"fileinfo" will show subsystem parts' versions.

The "Unix way" has always been to script or shell alias anything you'll do more than twice
that takes more than about 6 keystrokes

As far as Interix goes, this behavior has been the same since Interix 2.1 as I recall.

(in reply to bdavison)
Post #: 9
RE: Is this the correct Interix method? - May 19, '06, 6:11:19 PM   
woehlkmp

 

Posts: 102
Status: offline
Does that hotfix fix this problem? Alternatively, I wonder if my solution to that problem would also fix this problem... it's a little less ugly than having to know your stdin in advance.

(in reply to Rodney)
Post #: 10
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> Where to get rshsvc.exe service from Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.063