rsh - Remote Shell Client for Windows 95 version 1.0 Written by Silviu C. Marghescu (http://www.cs.umd.edu/~silviu) Copyright (C) 1996 Silviu C. Marghescu, Cornerstone Technologies, Inc. All Rights Reserved. rsh is free software; you can redistribute it in its entirety in any form you like. If you find any bugs, feel free to send me an email at silviu@c-stone.com. If you have added new features to rsh, please send me all the source code modifications, including the version of rsh that you are based on. Your additions may benefit other users. Disclaimer ========== rsh is distributed hoping that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it. The user must assume the entire risk of using the program. THE AUTHOR SHALL NOT BE HELD LIABLE FOR ANY KIND OF DAMAGES OR CLAIMS THAT DIRECTLY OR INDIRECTLY RESULT FROM USING THIS SOFTWARE. Description =========== rsh is a multithreaded client process that opens connections to rsh daemons, sends a command to be executed on the remote server and retrieves its output, both stdout and stderr. The connection is made on standard port 514 (tcp port for the shell/cmd protocol). The only free/shareware rsh clients out there that I was able to find are windows applications; the main goal for rsh was to be as simple as possible, a console application, so that it could be run from within more complex client-server environments that need to transfer commands/data between Windows and Unix machines. Due to the lack of a serious Unix server, rsh has not been thoroughly tested against a Unix implementation of an rsh daemon. Its main purpose for now was to work fine with my NT/95 rshd (available for free probably on the same site where you got this rsh client). Important note: rsh was designed and implemented to be convenient and reliable, rather than tightly secure. When passed a user name, rsh will trust that you really are who you're claiming; it will be up to the rsh daemon on the server site to make sure no harm is done. Requirements ============ o An Intel processor based machine running Microsoft Windows NT or 95 and TCP/IP. o Window Socket DLL installed properly (version 1.1 or higher). Installation ============ This package contains the following files: readme.txt - this file rsh.exe - the rsh client executable The source distribution also contains: rsh.cpp - the C++ source file (actually mostly C, but I prefer to define variables when I really need them; plus, I like the // comments) rsh.mak - the project file for Microsoft Visual C++ 4.1 Running rsh ============ rsh is a command line application. I am currently using is both for running commands on remote machines and for firing processes from within VB applications. Command line: rsh [-dvh] [-l username] hostname command Command line options: -d enables debugging messages. Good for those days when nothing works... -l username specify the user id under which the remote command is to be executed; also used for remote authentication. If this option is left out, "nobody" will be the default value; a pretty good reason for your command not to run if the rsh daemon is strict about who is running what on its server (in that case, make sure you pass a real user name). -v displays the rsh version. -h help screen. I have only tested rsh with my NT/95 rshd. Any experiences with other rsh servers would be greatly appreciated. Depending on the command interpreter you're using (command.com, 4dos.com, ...), special care should be taken when you are sending complex commands. If the command you send to the server has input/output redirection, or uses pipe operators, the whole command has to be enclosed in double quotes. Examples: rsh -d big-server dir c:\ Return the root directory list of the "big-server" machine; display debug info. rsh -l silviu antares "dir c:\ /s | wc -l" Give an approximate count of files on the antares machine. rsh -l root router "rm -rf /etc" Don't try this one! Security considerations ======================= As stated above, security was not the main issue while implementing rsh. An rsh daemon will try to authenticate the remote user/host; the host will be automatically detected as the host where the rsh client is running. The username however will be either the one you pass in the command line, or "nobody" if you leave it out. Rebuilding rsh =============== You probably have the sources already... I've built rsh only with Visual C++ 4.1. Any port to a different compiler (Borland, Symantec) would be interesting. Known problems ============== I've tried to fix all of the problems I have run into. Whether you have good or bad comments, improvements and suggestions, I would like to hear from you at silviu@c-stone.com.