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 |
|
Login |
|
|
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.
|
|
|
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.
|
|
|
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 >
|
|
|
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.
|
|
|
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"?
|
|
|
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)
|
|
|
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.
|
|
|
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.
|
|
|
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 |
|
|
|