INTRODUCTION TO WINSOCK REXECD/95
Winsock REXECD/95 (Remote Exec Daemon) is a service for Windows 95 and Windows 98 that services the standard rexec command, which allows remote program execution. It accepts requests from the rexec command from other hosts on the network via TCP/IP and executes them on the system running Winsock REXECD/95. It runs under Microsoft Windows 95 or Windows 98. It does not run under Windows NT; use our Winsock REXECD/NT for Windows NT.
The rexecd service differs from the similar rshd (Remote Shell Daemon) service in that rexecd requires you to supply a valid password before access is allowed. The rshd service does not require a password and enforces security in a different (and less secure) method.
Since Windows 95/98 does not provide its own consistent password validation facility, Winsock REXECD/95 provides its own. You must set up users and passwords using the Winsock REXECD/95 Control Panel applet before it can service rexec commands.
Also, Windows 95/98 does not allow multiple simultaneous login sessions, so any programs executed or files accessed through REXECD/95 will use the same access permissions as the user currently logged in to Windows 95/98. Even though a different user might be specified in the rexec command, that user will only be used to determine the correct password; it does not affect the programs or files that may be accessed. Use Windows NT if you need that type of security.
Winsock REXECD/95 is similar to the Unix rexecd, but provides some special functionality for the Windows environment, such as:
· Capturing of standard output/standard error output of Console and MS-DOS programs
· Sending keystrokes to GUI programs started with rexec
· Supports a non-standard version of the rcp command for copying files using the rexec protocol
· Optional automatic conversion of text files between Unix and Windows format with rcp copies
Command requests can come from clients running other operating systems such as Unix or from other Windows systems running Windows NT, Windows 95, or Windows 3.x. You can use the rexec utility that comes with your TCP/IP package or the rexec command in Denicomp Systems Winsock RCP/RSH/REXEC package (a separate product). Unix and Windows NT both have their own rexec commands; Windows 95/98 and Windows 3.x do not. Some third party TCP/IP packages include rexec.
Files can also be copied to or from the Windows system running Winsock REXECD/95 using a non-standard TCP/IP rcp command. The standard rcp command uses the rsh protocol to initiate the connection to the host. Winsock REXECD/95 supports rcp copies from an rcp command that initiates the connection using the rexec protocol instead. This is referred to as "RCP/X" in this documentation. Denicomp Systems has a version of the rcp command in its Winsock RCP/RSH/REXEC for Win32 package that supports the rexec protocol. This software works on Windows 95/98 and Windows NT systems only. For other operating systems, such as Unix, you would need to obtain source code for the rcp command and modify it to support rcp copies through rexec, so this capability may be of limited usefulness in that environment.
Winsock REXECD/95 requires a computer running Windows 95 or Windows 98, the TCP/IP protocol, and a network. It does not work under Windows NT - use our Winsock REXECD/NT under Windows NT.
The purpose of a Remote Exec Daemon is to service the standard rexec command. Although rexec requires users to supply passwords before being granted access, there is the risk of unauthorized users being granted access to your system when running Winsock REXECD/95 (or any Remote Exec Daemon, for that matter). This risk is greatly increased if the system running Winsock REXECD/95 is connected to the Internet. Winsock REXECD/95 provides additional mechanisms besides password validation for you to determine which hosts and users are granted access to your system. Firewalls can also help to reduce this risk. But the risk of unauthorized access still remains.
By installing Winsock REXECD/95, you are taking this risk of unauthorized access upon yourself. By installing Winsock REXECD/95, you are agreeing that you will not hold Denicomp Systems responsible for any damage caused by unauthorized access to your system through the standard rexec (and rcp) commands. Denicomp Systems did not design the rexec and rcp protocols; REXECD/95 simply implements the standard originally designed for Unix systems.
Please review the license agreement included with Winsock REXECD/95 and do not continue with the installation or with using it if you do not accept its terms.
WINSOCK REXECD/95 INSTALLATION
As will be explained later, you can install Winsock REXECD/95 as a Windows service or as a Windows application. A service is a special Windows program that automatically starts in the background when Windows starts. It runs even when no one is logged on to Windows. An application is simply a standard Windows program that you execute from the Start menu or from the command prompt. Applications only run when someone is logged in to Windows; when you log out to log in as another user, Windows will stop the application.
Normally, you will want to install Winsock REXECD/95 as a service. The only time you would not want to install REXECD/95 as a service would be if you only wanted to have REXECD/95 running occasionally when you manually start it.
If you received a diskette, insert the Winsock REXECD/95 diskette into your diskette drive. Click on Start, then Run. Then type the drive letter of your diskette drive followed by "SETUP". For example, if the diskette is in the A: drive, type "A:SETUP". Then press the Enter key. (This can also be done from a DOS Prompt if you prefer).
If you have downloaded a .ZIP file, you probably have already unzipped the file into a directory. From that directory, execute SETUP.EXE. You must not install the software into the same directory where you unzipped the files.
The Winsock REXECD/95 Installation window will then appear. Verify that the drive letter or directory shown in the Source field is correct. If it is not, specify the proper drive or directory.
Specify the directory in which you would like Winsock REXECD/95 to be installed in the Destination field. This will default to the \WREXEC95 directory on the drive where Windows is installed. You may change it if you wish. However, if you are installing REXECD/95 as a service, you must install REXECD/95 on a local hard drive, not a network drive. Windows may not have access to the network drive when it starts services.
If you do not want Winsock REXECD/95 to be installed as a Windows Service, uncheck the Install as Service option and it will not be added to the list of Windows Services. Winsock REXECD/95 can be run as an application instead of a service if you wish (details on how to do this are provided later).
Press the Install button to begin the installation. Press Cancel if you wish to exit. Files will be copied to the destination directory.
See the section on Winsock REXECD/95 Utilities for instructions on how to manually start and stop the Winsock REXECD/95 service.
To remote Winsock REXECD/95, use the Add/Remove Programs icon in the Control Panel. Find Winsock REXECD/95 in the list of programs installed, click on it, then click on the Remove button. This will remove REXECD/95 from your system.
If for some reason this does not work, you can remove Winsock REXECD/95 manually. You must first stop the Winsock REXECD/95 service, then remove the service from the list of services before deleting the files. From the Windows Control Panel, double-click on the REXECD icon. Then, from the Winsock REXECD/95 Control Panel, click on the Service Control button.
From the Winsock REXECD/95 Control menu, first select Stop the Winsock REXECD/95 Service. Then select Remove the Winsock REXECD/95 Service.
Removing the service does not actually delete any files. It only removes REXECD/95 from the list of services.
You can then delete the Winsock REXECD/95 directory. You should also delete the files WREXEC95.CPL in the Windows System directory (\WINDOWS\SYSTEM for example). This is the Control Panel applet for Winsock REXECD/95.
You can also remove the REXECD/95 registry entries using REGEDIT. Delete the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\DenicompSystems\REXECD95\Setup
RUNNING WINSOCK REXECD/95 AS AN APPLICATION
You can optionally run Winsock REXECD/95 as a Windows application instead of a service. This requires that someone log in to Windows and start Winsock REXECD/95 (unless you add it to the StartUp folder; then it will start automatically after logging in).
To start Winsock REXECD/95 as an application, execute the following command:
wrexec95 /s
If you are executing this command from the Windows DOS Prompt, you should use the command:
start wrexecnt /s
If you do not use the start command, you will not have access to that DOS Prompt window until Winsock REXECD/95 is stopped. Be sure that you do not already have Winsock REXECD/95 running as a service.
When Winsock REXECD/95 is started, it will display a window where messages about the status of Winsock REXECD/95 will display. The number and type of messages that display depends on the Message Level option in the Winsock REXECD/95 Configuration.
To stop Winsock REXECD/95, simply close the window or activate the window and press Control-C.
WINSOCK REXECD/95 CONFIGURATION
Windows 95 and Windows 98 do not have a consistent password validation facility. Depending on the type of network you use, passwords are either validated locally (a peer-to-peer network), on a Windows NT server, on a Novell server, or on a Unix server (using Samba for instance).
Since REXECD/95 must validate passwords, it provides a method for you to define users and passwords. Only those users and passwords you set up will be permitted to issue rexec commands to this system. These users and passwords are set up using the Winsock REXECD/95 Control Panel applet.
The REXECD/95 Control Panel applet also allows you to change many other options that affect the way REXECD/95 operates. Winsock REXECD/95 will work properly using its default configuration. Other than setting up users and passwords, you only need to configure Winsock REXECD/95 if you wish to change any of the available options, enable security, or use the logging capabilities.
To set up users and passwords or change other configuration options, in the Windows Control Panel, double-click on the REXECD icon to configure Winsock REXECD/95. In the REXECD/95 applet, you can press <F1> at any time to display help information about the options available.
After changing most Winsock REXECD/95 Configuration options, you do not need to stop and restart Winsock REXECD/95. It will recognize the change, unless you disable the monitoring of the registry (see below).
In order to use Winsock REXEC/95, you must set up a least one user and password. User and password information is stored on your hard drive in an encrypted file named rexecpwd.dat in your Winsock REXECD/95 installation directory. The file is hidden and read-only, so you will not normally see it listed and you will not be able to delete it unless you change the read-only attribute.
When setting up users, you can use three different formats when specifying the user login name:
User - give user access from any host with the specified password
User@host - give user access only from host with the specified password
User@ipaddr - give user access only from the IP address ipaddr with the specified password
You can use a mix the various formats if you wish. However, if you specify a user without a host or IP address and the same user with a host or IP address, only the user/password without the host or IP address will be used and the others will be ignored. So, while you can use a mix of the formats for different users, you cannot mix them with the same user.
To add a new user, enter the user's login name and password and click on the Add button.
To change an existing user, find that user in the user list and click on it once. Then click in the field you wish to update (the login name and/or the password) and make the necessary changes. Then click on the Update button to save your changes.
To delete a user, find that user in the user list and click on it once. Then click on the Delete button.
Security File: (Default: None)
Specify the full path name of the Security File used by Winsock REXECD/95 to enforce security (allow and deny users and hosts). The format of this file is explained in more detail later. If you do not specify a Security File, all users and hosts will be granted access to execute programs and transfer files to and from your system using rexec and rcp if they supply a valid user and password.
If you do specify a Security File and it does not exist or REXECD/95 cannot access it (because of insufficient permissions), no users or hosts will be granted access. Also be sure to save the Security File as an ASCII text file; if you save it in some other format (such as Write, Word, or Unicode), REXECD/95 will not be able to understand the data in the file.
Also, if you use the Edit Security button, it will start the Windows Notepad and allow you to edit the Security File you specified. However, Notepad automatically appends a .txt file extension to files, so if you do not specify a .txt file extension in the Security File name and you use this button, be sure to use Save As in Notepad to use the name you specified or add the .txt to the end of the name in the Security File field. If you do not, REXECD/95 will not be able to find the file you created; it does not automatically add the .txt extension.
If you do not wish to enforce any security, do not specify a filename.
Message Log: (Default: None)
Specify the full path name of a file where any messages from Winsock REXECD/95 should be stored. The message file is optional. You should only enable the message log when you are trying to find the source of a problem, since the message log can become quite large on an active system.
This option is used in conjunction with the Message Level option. If Message Level is set to a value greater than zero (0), Winsock REXECD/95 will output messages that provide information about its operation. These messages are mostly useful for problem determination.
The message file created is a text file that you can examine at any time using utilities such as TYPE or MORE, or editors such as Notepad. You can clear the message log at any time by simply deleting it.
Message Level: (Default: 0)
Specifies the level of detail of the messages stored in the file specified in the Message Log option. The default level is 0, which will not write any messages to the message log file. Levels 1 through 4 will product increasing amounts of detail (level 1 provides the least detail, level 4 provides the most).
Request Log: (Default: None)
This option allows you to log all requests (programs to be executed) in a file you specify. Each time someone attempts to execute a program through Winsock REXECD/95, the date and time, the user name, the host name, and the program will be written to this file.
Deny Log: (Default: None)
This option allows you to log all permission violations in a file you specify. Each time someone is denied permission to execute a program or copy a file through Winsock REXECD/95, the date and time, the user name, the host name, and the program will be written to this file.
Error Log: (Default: None)
This option allows you to log all program execution errors in a file you specify. Each time someone receives an error trying to execute a program through Winsock REXECD/95, the date and time, the user name, the host name, the program, and error message will be written to this file. These are errors that occur after the user has been granted permission to execute the program. For example, an error would be logged if a program were to be run that did not exist.
NOTE: Each of the log files may refer to the same file name if you wish. They will not overwrite each other. Each message is appended to the end of the file. You should be sure to periodically delete the log file(s) because they can get large over time on an active system.
Reject All Incoming REXEC Commands? (Default: Unchecked)
If you check this option, all incoming rexec commands will be rejected, effectively disabling the rexec serving capability of REXECD/95. This is useful if you only want to use REXECD/95 as an rcp server.
If a remote user attempts to issue an rexec command to this system, an error will be returned to the remote user stating that rexec has been disabled.
Attempt Redirection on Every Command? (Default: Checked)
If this option is checked (it is by default), Winsock REXECD/95 will assume that each program executed by rexec is a Windows Console application or MS-DOS program and attempt to send its standard output/standard error back to the rexec client and send the standard input from the rexec client to the program.
When you execute a program through Winsock REXECD/95, it cannot tell whether the program is a Windows graphical application (which has no standard input or standard output) or a console application (character application with standard input and standard output).
If you check this option, you still may execute Windows programs via rexec and they will operate properly. However, unless you specify the special <[WIN]> indicator for Windows programs in the rexec command, there are a few downsides. First, there will be slightly more overhead when executing Windows programs because Winsock REXECD/95 will attempt to capture the standard output/standard error (and there is none). Also, Winsock REXECD/95 will wait for the Windows program to complete before closing the connection, which means the rexec command on the client will not end until the program executed ends. These downsides can be overcome by specifying the <[WIN]> indicator in the rexec command when you do not desire this behavior.
Execute All Commands through Command Shell? (Default: Unchecked)
If you check this option, Winsock REXECD/95 will automatically prefix every program you execute with the default command shell (usually command.com /c).
This is useful if you commonly execute batch files (.BAT) or other command scripts for the shell you are using and you do not want to have to specify the shell command in every rexec command.
The default shell command is used as the prefix. This command can be specified in the Default Shell Command field; if no default shell command is specified there, command.com /c is used.
For example, if this option is enabled and you execute the following command from a remote system:
rexec win95 xyz.bat
REXECD/95 will execute the command as: command.com /c xyz.bat
Disable Detection of Internal Commands (Default: Unchecked)
When you execute a program through Winsock REXECD/95, it examines
the command to determine whether or not it is a command internal to the default command
shell (interpreter). If it is, it automatically prefixes the command with the default
command shell (specified in the Default Command Shell field). Some commands are not actually programs; they are interpreted and executed internally
by the command shell. In the Windows command interpreter (COMMAND.COM), some examples of
these are DIR, SET, and COPY. If you look on your hard drive, you will not find a DIR.EXE
or COPY.EXE. They are part of the command interpreter, COMMAND.COM. So, if you tried to execute a DIR command through REXECD/95, it would not find the
program since it doesnt exist. You would have to tell it to use the command
interpreter by executing the command COMMAND.COM /C DIR. By default, REXECD/95 examines the command and if it determines that the command is an
internal command, it adds the shell command for you. You can disable this by checking this
option. All commands will be executed as they are specified in the rexec command. NOTE: If you check the option Execute All Commands through Command Shell?,
this option is irrelevant, since the command shell will be added to the command in all
cases.
Default Window Type for Commands: (Default: Normal)
This specifies the default window type to be used when executing
commands through Winsock REXECD/95 using the rexec command. The default window type
is used when the special window type indicators (<[NORMAL]>, <[MINIMIZE]>,
<[MAXIMIZE]>, <[HIDE]>, etc.) are not specified in the rexec
command. The options available are: Normal: The window for the command will display at its normal size. Minimized: The window for the command will be minimized (without focus). Maximized: The window for the command will be maximized. Hidden: The window for the command will be hidden. There are a few points you must consider when selecting the default window type:
List of Commands to Allow (File) (Default: None)
This option allows you to specify the name of a file that contains a list of commands that users are permitted to execute on this system through rexec. This allows you to provide strict control over the commands users can execute.
If no filename is specified here, all commands are permitted.
The file must be a plain text file, with each permitted command on a line by itself. Commands in the file should not contain any spaces. Comparison of commands is done only up to the first space or tab character.
When a user executes a command on this system through rexec, REXECD/95 will extract the first part of the command, up to the first space or tab character, and compare that to the lines in the file specified. If it does not exist in the file, the rexec command will be rejected.
Environment Variable File (Default: Blank)
This allows you to specify the name or names of files that contain environment variables that should be made available when programs are executed by REXECD/95 through rexec.
Normally, the environment for programs executed through REXECD/95 comes from the environment variables initially set when the system boots (these are set in AUTOEXEC.BAT). It the variables in AUTOEXEC.BAT are changed, you must reboot the system for them to be propagated to REXECD/95 (if you are running REXECD/95 as a service).
Alternatively, you can create a custom environment for REXECD/95 by entering the environment variables and values in a plain text file. Each line in the text file should have the format:
VARIABLE=VALUE
Each time a program is executed through REXECD/95 by rexec, a custom environment is built from the file or files specified in this parameter, based on the lines in those files.
You can specify a single filename or multiple filenames, with each separated by semi-colons (;). Each file is read in sequence and added to the environment inherited by REXECD/95 (from AUTOEXEC.BAT) to create a new environment for the program to be executed. If a variable name appears in multiple files, the last value read will be used.
You may reference previously set environment variables as you do in Windows batch files using %VAR%. For example:
PATH=%PATH%;C:\MYPROGS
The filenames should be full path names. There are three special keywords that you can use in the filenames if you wish:
%user% - Substitute the login name of the remote user
%rhost% - Substitute the host name of the remote host
The %user% substitutes the login name of the remote user. This will be the login name the user used to log into the remote host from which the rexec command is being issued, unless the -l option of the rexec command was used to specify a different user; then that user will be substituted.
The %rhost% substitutes the host name of the remote host, if it is available. That is, REXECD/95 must be able to find the name of the remote host based on its IP address, either by using the HOSTS file or DNS. If it is not found, the IP address will be substituted.
These special keywords allow you to have different environment files for different users if necessary. For example, if you specify the environment variable file:
c:\env\%user%.env
When "john" issues an rexec command, REXECD/95 will get the environment from the file "c:\env\john.env". When "mary" issues an rexec command, REXECD/95 will get the environment from the file "c:\env\mary.env".
Also, using the capability to specify multiple files, you can have a single "master" environment, and then only modifications to it by user. For example, you can have a standard set of environment variables in the file "c:\env\master.env" and user-specific modifications in the file "c:\env\%user%.env". Your environment variable file field would read:
c:\env\master.env;c:\env\%user%.env
First the variables in master.env would be read, then those for the user in %user%.env.
The Special "new" Keyword
The format of the environment variable files must be:
VARIABLE=VALUE
But, with one exception. If you specify the word "new" on a line by itself in an environment variable file, it will purge all environment variables set up to that point.
The primary purpose of this would be to remove all variables inherited from the AUTOEXEC.BAT. It allows you to start with a "clean slate" and set all environment variables from scratch.
Default Command Shell (Default: None, use COMMAND.COM /C)
This option allows you to specify the default command shell to be used when REXECD/95 detects an internal command or the command shell to be used if the option to Execute All Commands through Command Shell is checked.
You should use this option only if you are using an alternate command shell. By default, REXECD/95 uses the Windows command shell COMMAND.COM. You must specify all necessary options to the command shell so that it can be prefixed to any command (internal or external).
If you end the shell command with a single quote (') or double quote ("), REXECD/95 will supply the closing quote. This is necessary if the shell program would interpret options to the command executed as its own option. For example, if you are using a Windows version of the Bourne shell, you should specify the following as the command shell:
sh -c '
If you do not specify the trailing quote, the sh command will interpret options to the commands you execute instead of passing them to the command.
Internal Command List (Default: None, use COMMAND.COM list)
If you specified a Default Command Shell that has different internal commands than those of the standard Windows command shell COMMAND.COM, you can specify the internal commands for that shell here. Separate each command with a comma (,). Do not include any spaces. By default, REXECD/95 recognizes the internal commands of the Windows command shell.
Internal commands are commands that are interpreted and executed by the command shell. They do not exist as executable files (.EXE or .COM). If REXECD/95 does not recognize a command as an internal command, you must prefix it with the command shell.
You only need to specify this list if you want REXECD/95 to recognize commands internal to your command shell and automatically prefix the command with the appropriate shell command.
If you checked the option to Disable Detection of Internal Commands, this is not necessary and will have no effect.
For example, you could specify:
cd,dir,type
Whenever you execute the command:
rexec win95 dir
It would see that "dir" is in the internal command list and prefix it with the Default Command Shell before executing it.
Buffer Stdout/Stderr Until End of Command? (Default: Unchecked)
Check this option if you want REXECD/95 to buffer (store in a file) the standard output and standard error output of the commands you execute, and then send all of the output when the command completes. When this option is checked, standard input from the rexec command is not passed to the program executed.
Occasionally, this option is necessary when the program executed also uses redirection or pipes.
Note that checking this option disables the ability to send standard input to the rexec command on the client system.
These options only affect rcp using the rexec protocol (the non-standard rcp command supported by REXECD/95). If you are running a Remote Shell Daemon (rshd) also, it does not affect those rcp commands.
Reject All RCP Copies to This System (Default: Unchecked)
If this option is checked, all attempts to copy files to this system
with the rcp command (using the rexec protocol) will be rejected with an
error message stating that incoming copies are disabled. This allows you to make the
system "read only" when using the rcp command. You can also reject
copying from the system, essentially disabling the rcp capability of REXECD/95.
Reject All RCP Copies to From System (Default: Unchecked)
If this option is checked, all attempts to copy files from this
system with the rcp command will be rejected with an error message stating that
outgoing copies are disabled. This allows you to make the system "write only"
when using the rcp command. You can also reject copying to the system, essentially
disabling the rcp capability if REXECD/95.
Preserve Case in Multi-File Copies: (Default: Unchecked)
Specifies whether Winsock REXECD/95 should preserve the case of
filenames when files are copied from this system by rcp using
wildcards or recursive copies. By default, when the remote system uses a wildcard or
recursive copy to get files from this system, Winsock REXECD/95 will convert all directory
and filenames to lowercase letters before sending them to the remote system. Although the Windows file system is not case sensitive (ABC and abc are the same file),
it can store the case of the filename. When copying files via rcp to
operating systems that are case sensitive, such as Unix, it is usually most useful to
convert all of the names to lowercase letters. If you do not wish to have all of the names converted to lowercase letters, check this
option. The rcp command will then create files in exactly the same case as the
names appear in the directory under Windows. Note that this affects only wildcard and recursive copies. When copying
individual files, the files will be created in the case you specify in the rcp
command.
Automatic End-of-Line Conversion (Default: Never)
This specifies whether or not REXECD/95 should perform any
end-of-line conversions on files transferred to or from the Windows system using rcp. Under MS-DOS, Windows 3.x, Windows 95, and Windows NT, lines of text are delimited by
carriage return and newline pairs (ASCII 13 and ASCII 10). Under Unix, lines of text are
delimited by only newlines (ASCII 10). Often, when copying text files between the two
operating systems, it is necessary to convert the end-of-line delimiters to the proper
method. REXECD/95 provides a way to automatically do this. When files are copied from the Windows system through REXECD/95, carriage returns will
be removed from all carriage return/newline pairs (i.e. converted to Unix format). When
files are copied to the Windows system through REXECD/95, carriage returns will be added
to every newline character that is not already prefixed by a carriage return (i.e.
converted to Windows format). There are four options available. The option you select affects all rcp copies
to this system and all rcp copies from the system. It does not affect the operation
of the rcp command on the Windows system. It only affects the result of rcp
commands that access files on this system from other systems. No end-of-line conversion will be done. All files will be transferred or received
unmodified. Convert the end-of-line characters on every file copied from or to this system through
REXECD/95. Only convert end-of-line characters in files ending with the specified list of file
extensions; any file not ending in the specified extensions will be copied without
modification. You must then enter the list of file extensions. Separate each file
extension by a comma. Do not include any spaces. You must include the "dot" (.).
For example: .TXT,.C,.H,.PRN,.MAK REXECD/95 will examine the contents of the first block of the file to be sent or
received and determine whether or not an end-of-line conversion is necessary. If the first
block contains only text characters (letters, numbers, spaces, tabs, carriage returns,
newlines, backspaces, escapes, and form feeds), REXECD/95 will perform an end-of-line
conversion on the file. If the first block contains any other non-text data, it will be
copied without modification. The size of the first block is specified in the RCP Block Size field.
RCP Home Directory (Default: Blank)
Specifies the starting directory where files will be copied from or
to when a relative path name is used in an rcp command (no initial slash or
backslash). This directory must exist if specified. The directory name specified can contain the
following special keywords: %user% - Substitute the login name of the remote user %rhost% - Substitute the host name of the remote host The %user% substitutes the login name of the remote user. This will be the login
name the user used to log into the remote host from which the rcp command is being
issued, unless the @ option of the rcp command was used to specify a
different user; then that user will be substituted (e.g. user@host:filename). The %rhost% substitutes the host name of the remote host, if it is available.
That is, REXECD/95 must be able to find the name of the remote host based on its IP
address, either by using the HOSTS file or DNS. If it is not found, the IP address will be
substituted.
RCP Block Size: (Default: 512)
Specifies the number of bytes in a block of data that the Remote Copy (rcp) service of Winsock REXECD/95 processes at one time. When files are copied to the system, it reads from the network and writes to the disk in blocks of this size. When files are copied from the system, it reads from the disk and writes to the network in blocks of this size. Note that this is an internal block size only; it does not change any TCP/IP parameters.
RCP Spoofing Prefix: (Default: None)
This specifies the first characters of the rcp command send by the remote host that Winsock REXECD/95 should use when "spoofing" the rcp protocol. With its roots in Unix, the rcp command actually internally executes an rsh (or rexec when using the non-standard rcp supported by REXECD/95) to start rcp on the remote host before transferring files. REXECD/95 "spoofs" or looks for rcp commands executed through rexec by the remote host and services the rcp transfer.
By default, Winsock REXECD/95 looks for the command prefixes of:
rcp -
/usr/bin/rcp -
/usr/lib/sunw,rcp -
set vms_rcp = 1 ; rcp -
Some rcp commands (especially those on non-Unix and non-Windows systems) may send other commands to initiate the rcp protocol. If yours does, you should enter the command prefix (up to and including the first hyphen) here. The last character should always be a hyphen with nothing after it, including spaces.
Regardless of the spoofing prefix entered, Winsock REXECD/95 will continue to look for the above default prefixes.
Installation Directory: (Default: C:\WREXEC95)
This is the directory where Winsock REXECD/95 is installed. This will be filled in by the REXECD/95 installation program. If you move REXECD/95 to another location, you must update this.
Initial Working Directory: (Default: None, use Installation)
This specifies the directory that will initially be considered the current working directory for all commands executed using rexec. It will also be considered the current working directory for all files copied using rcp, unless an RCP Home Directory is specified. If this is blank, then the Installation Directory becomes the initial working directory.
When REXECD/95 starts, it changes to this directory and remains there, unless an rexec request is received to execute the cd or chdir command, which will change REXECD/95s working directory.
Note that a cd or chdir command will change REXECD/95s working directory for all subsequent commands, regardless of the user or system they are executed from.
Disable Multithreading in REXECD/95: (Default: Unchecked)
Multithreading allows Winsock REXECD/95 to process multiple requests simultaneously. When multithreading is disabled by checking this option, Winsock REXECD/95 will accept and complete only one request at a time. Other requests received during this time will be queued and executed in the order in which they were received. Normally, you will want multithreading enabled, but you can disable it, for example, to ensure that the system will not become bogged down with requests.
Disable Monitoring of Registry for Changes: (Default: Unchecked)
Normally, the Winsock REXECD/95 Control Panel applet sends a signal to REXECD/95 when options are changed so that it re-reads the registry and the changed options take effect. It does this when you close the REXECD/95 Control Panel applet with the OK button.
If this option is checked, the signal will not be sent and you must stop and start Winsock REXECD/95 manually (or reboot the system) for the Registry changes to take effect.
You may want the Registry monitoring disabled for security purposes so that no Winsock REXECD/95 options are changed while the system is in operation.
Host IP Address (If Multi-Homed): (Default: None)
If your system is multi-homed (it has multiple network cards, each with its own IP address), you can specify which IP address REXECD/95 will use to listen for requests. If you leave this empty, it will accept requests from any of the IP addresses associated with the system. If you specify one of the addresses of one of the cards (in dotted-decimal format), it will only accept requests routed to that address.
Listen Port: (Default: 512)
Specifies the port number that Winsock REXECD/95 listens to for connections. The standard port for the Remote Shell daemon is 514.
Listen Backlog: (Default: Windows Maximum)
Specifies the number of requests that can be backlogged when Winsock REXECD/95 is listening for connections. The minimum is 1; the maximum is dependent on the version of Windows being used. The maximum under Windows 95/98 is usually 5.
WINSOCK REXECD/95 SECURITY FILE
With Unix, security is enforced on remote command execution using rexec by validating the user and password.
In addition to user and password validation, Winsock REXECD/95 enforces security through the Security File. The name of this file is specified in the Winsock REXECD/95 Configuration in the Security File entry.
If you specify a Security File name and the file does not exist or the file is completely empty, all hosts and users are denied access.
Conversely, if you do not specify a Security File, all hosts and users are granted access if a valid user and password is supplied.
You create the Security File using a text editor. If you are using the Winsock REXECD/95 Control Panel applet, you can click on the Edit Security button to run the Windows Notepad editor to edit the Security File specified in the Security File configuration option.
The Security File consists of lines that specify who may or may not access the system using Winsock REXECD/95. The following are the options available:
# | Any line beginning with # is treated as a comment and is ignored. |
+ | A plus sign (+) on a line by itself specifies that ALL hosts and users are granted permission. This is useful if you wish to allow many hosts and users, but deny only a few. Use the deny options on subsequent lines. |
Host | You can specify a host that is granted permission by entering the name of the host on a line by itself. All users on that host are granted permission, unless you specifically deny those users on subsequent lines. |
!host | You can specify a host that is denied permission by entering an exclamation point (!) followed by the name of the host name of the host on a line. All users on that host are denied permission, regardless of subsequent lines. |
+user | You can specify a user name that is granted permission by entering a plus sign (+) followed by the user name on a line. Do not put any spaces between the plus sign and the user name. That user will be granted permission regardless of the host (as long as the host is not specifically denied). See below for an explanation of the source of the user name and how it is validated. |
-user | You can specify a user name that is to be denied permission by entering a minus sign (-) followed by the user name on a line. Do not put any spaces between the plus sign and the user name. That user will be denied permission on all hosts. See below for an explanation of the source of the user name and how it is validated. |
+user@host | You can specify a user name and a host that is granted permission by entering a plus sign (+) followed by the user name, an at-sign (@), followed by the host name on a line. Do not put any spaces between the plus sign and the user name or before or after the at-sign. That user on the specified host will be granted permission, but only from that host. |
-user@host | You can specify a user name and a host that is denied permission by entering a minus sign (-) followed by the user name, an at-sign (@), followed by the host name on a line. Do not put any spaces between the minus sign and the user name or before or after the at sign. That user on the specified host will be denied permission, but only when coming from that host. |
When specifying the host on the lines in the Security File, you may use either a host name or an IP address (in dotted-decimal format). If you use a host name, that name must be resolvable by TCP/IP, either through the hosts file or through DNS.
You may use wildcard characters when specifying the user and/or host name in the Security File. The wildcard characters that can be used are:
* | Matches multiple characters. Example: *.sprynet.com |
? | Matches a single character. Example: 192.72.124.?? |
[ ] | Matches a list of characters or range of characters. Example: 204.22.6[5-9].* |
[! ] | Matches characters NOT in a list or range of characters. Example: 204.22.[!5-9]?.* |
If the request is coming from a Unix system, the user name is the login name of the user. If the request is coming from a Windows PC or non-Unix operating system, the method of specifying the user name is determined by the implementation of the rexec or rcp command you are using.
To effectively use the Security File, you must first understand how it is viewed by Winsock REXECD/95.
When Winsock REXECD/95 receives a request, it sequentially processes the lines in the Security File to determine whether or not the host and user are granted or denied access. It looks at each line in the Security File until it determines that either the host or the user is specifically denied permission.
Winsock REXECD/95 begins by assuming that permission is denied for the request. It then examines the lines in the Security File to see if any of the lines pertain to this request.
Once Winsock REXECD/95 finds a line that denies access to either the user or the host, it stops looking and denies permission.
If it finds a line that grants permission to the user and/or host, permission is tentatively granted, but it continues to process the lines in the Security File.
If it processes the entire Security File and does not find a line that grants permission to the user and/or the host, permission is denied. If security was tentatively granted at some point and not denied subsequently, permission is granted.
For example, let's say that the following is the contents of the Security File:
jetty
booey
eib
192.56.42.3
rs6000
+fred@mars
-gary@booey
-jackie
+robin
*.netcom.com
In this example, if any user on the host "jetty" makes a request, permission will be granted, unless the user is "jackie", since "jackie" is denied access from all hosts (-jackie).
If "jackie@jetty" makes a request, Winsock REXECD/95 reads through the Security File and finds the host name "jetty", and tentatively grants permission. However, it continues and finds that the user "jackie" is denied from all hosts, so permission is denied.
Also, if any user on the host "booey" makes a request, they are granted permission unless the user is "gary", since "gary@booey" is specifically denied permission (-gary@booey). All other users on the host "booey" are granted permission except "jackie" (-jackie).
The user "fred" on the host "mars" is granted permission because of the line "+fred@mars". However, since the host "mars" does not appear on a line by itself, no other users on the host "mars" are granted permission except the user "robin", who is granted permission from any host (+robin).
Finally, all users making requests from systems whose host names end in ".netcom.com" are granted permission, unless the user is "jackie", since "jackie" is denied permission from all systems.
TROUBLESHOOTING THE SECURITY FILE
If you think you have properly set up the Security File, but you are being denied access when you think you should be granted access, the following provides some tips on determining the cause of the problem:
If these tips do not help, enter a filename in the Message File field and a 4 in the Message Level field in the REXECD/95 Control Panel applet. Then execute rexec or rcp from a system that should be given access, then examine the Message File. It will contain a trace of the steps REXECD/95 is using to validate the remote user and host.
With Unix, the rexec utility executes the specified program on a remote host and returns the standard output and the standard error output to the rexec command. You can then see the output of the programs on your screen.
When you execute console or MS-DOS programs using rexec, you will also see the standard output and standard error output of those programs. Console and MS-DOS programs are character-based and write output to the standard output/error, which REXECD/95 can capture and return to the remote system.
For example, the following command would display a directory of the C: drives root directory on your screen (assuming REXECD/95s default configuration is being used):
rexec win95 dir c:\\
Note the double backslashes (\\). If this rexec command is being issued from a Unix system, Unix uses the backslash as an "escape" character. To send a single backslash to REXECD/95, you must specify two.
With Windows graphical programs, there is no such thing as "standard output" and "standard error". Programs execute in graphical windows, so there is no way to return any output using rexec. (There are also some console and MS-DOS programs that write directly to the screen and their output cannot be returned either.)
Therefore, when using rexec to initiate programs on a Windows system, you will not see any output of graphical programs on your screen (where the rexec command was used). It will display on the Windows system that received the request.
For example, if you used the following command:
rexec win95 excel
This would start Excel on the Windows system named "win95" (assuming "excel.exe" was in the PATH). You would see nothing on your screen as a result of starting Excel. Excel would be running on the screen of the Windows system named "win95".
If you attempt to execute a program that does not exist or Windows returns an error trying to load the program, you will receive a descriptive error message on your screen from Winsock REXECD/95 to tell you that the program was not successfully executed.
Important Note: Winsock REXECD/95 uses the PATH and other environment variables specified in AUTOEXEC.BAT. If you are trying to execute a program that Winsock REXECD/95 cannot find, check the environment variables. You can also use an Environment Variable File to change the PATH; see the section on configuring REXECD/95 for more details.
EXECUTING INTERNAL SHELL COMMANDS
Some commands that you can execute at Windows DOS Prompt are not actually programs; they are internally recognized by the command interpreter COMMAND.COM. One example of this is the DIR command. If you look in the directory where Windows is installed, there will be no DIR.EXE. It is part of COMMAND.COM.
Winsock REXECD/95 recognizes internal commands and will execute them through the command interpreter. Prefixing the internal commands with "command.com /c" is no longer necessary, although it will still work if you do.
If you are using an alternate command shell, you can specify this shell and its internal commands in the REXECD/95 Control Panel applet. REXECD/95 will then recognize them and prefix them with your command shell.
STANDARD INPUT/OUTPUT/ERROR REDIRECTION
You can optionally capture the standard output and standard error output of Windows Console or MS-DOS programs through Winsock REXECD/95 with the rexec command. This allows you to display the output of these programs that output to the standard output or standard error on another screen or capture it to a file on another system. It also allows you to send the standard input from rexec to the remote program. This is known as redirection.
By default, Winsock REXECD/95 automatically attempts redirection on every program executed using rexec, to capture the standard output and standard error and send it back to the rexec command, and receive standard input sent to it by the rexec command and provide it to the program executed.
If you mostly execute Console or MS-DOS programs through REXECD/95, this default behavior of automatic redirection is the most useful. However, it does have some downsides when you want to execute graphical programs through REXECD/95 (which do not have standard input/output/error) or you simply do not need redirection even for console or DOS programs.
The downsides to automatic redirection are:
You can control this in two ways, if necessary:
Option 1. If you only occasionally need to use rexec to execute graphical programs or console/DOS programs where you do not want rexec to wait until they complete, you can add the special "<[WIN]>" option in the rexec command. This tells REXECD/95 that it should not attempt redirection on this program only. For example:
rexec win95 "<[WIN]>" excel
This will start Excel on the system named "win95" and REXECD/95 will not attempt any redirection. The rexec command will end immediately after Excel starts; it will not wait until Excel exits. Without the "<[WIN]>", the rexec command would not end until you closed Excel.
Option 2. If you mostly execute graphical programs or you usually do not want to do redirection on console/DOS programs because you do not care about the output, you should uncheck the option labeled Attempt Redirection on Every Command in the REXECD/95 Control Panel applet. If you uncheck this option, REXECD/95 will not automatically attempt redirection, unless you specify the special "<[CON]>" option in the rexec command. This tells REXECD/95 that it should attempt redirection on this program only. For example:
rexec win95 "<[CON]>" net view
This will run the "net view" command on "win95" and display the output on your screen. The "net view" command displays information on the standard output.
WAITING FOR COMMANDS TO COMPLETE
If you have unchecked the REXECD/95 Control Panel option labeled Attempt Redirection on Every Command, programs executed through rexec will return control back to rexec immediately after the program begins. It will not wait until it completes.
If you want the rexec command to wait until the program finishes executing, you can use the special "<[WAIT]>" option in the rexec command. For example, to execute the command "bkgprint" and wait for it to finish, use:
rexec win95 "<[WAIT]>" bkgprint
Winsock REXECD/95 provides the ability for you to send keystrokes to a graphical Windows application you initiate using the rexec command. It also allows you to specify how the window is to be displayed (i.e., normal, minimized, maximized, or hidden). This provides you with some "remote control" over what the program you run does once it starts.
You cannot send keystrokes to an application started through Winsock REXECD/95 if there is no one logged in to Windows. The program will be executed, but it will not receive the keystrokes. When Windows is at a login window, other programs cannot receive keystrokes because Windows is waiting for you to log in.
If you are familiar with Microsoft Visual Basic or the Visual Basic for Applications (VBA) macro language, sending keystrokes s is very similar to the SendKeys capability of those programming languages.
The standard syntax of the rexec command is:
rexec hostname command
This will execute "command" on the host "hostname". Winsock REXECD/95 allows a slight modification of the rexec syntax to send keystrokes. This is compatible with all rexec commands. The alternative syntax for sending keystrokes is:
If the first parameter after the host name begins with a less-than sign (<), that parameter is interpreted as keystrokes to be sent to the command specified in the next parameter. The keystrokes must end with a greater-than sign (>). You must also enclose the entire parameter in quotes so special characters and spaces are not interpreted by the operating system.
For example, if you wanted to run the Windows Notepad on the system named "win95" and type "This is a test" on the first line, the command would be:
rexec win95 "<This is a test>" notepad
If you looked at the win95's screen, you would see the Windows Notepad with "This is a test" on the first line.
You cannot send keystrokes to all applications. This is beyond Denicomp Systems control. Most applications will allow you to send them keystrokes, but there are a few that will not.
Winsock REXECD/95 also allows you to specify special keys in the keystrokes parameter that cannot normally be typed on a command line, such as embedded Enter keys, function keys, ALT keys, etc.
Keystrokes are sent sequentially as they appear between the "<" and ">". To send a single character, use the character itself. For example, to send the letter "X", use the letter "X". To send the word "hello", just specify those letters.
To specify keys combined with any combination of Shift, Ctrl, and Alt keys, prefix the regular key code to one or more of the following codes:
Shift | + |
Control | ^ |
Alt | % |
For example, to send the Alt-F keystroke, specify "%F". To send Ctrl-Alt-D, specify "^%D".
To send the Enter key, use the tilde (~).
To specify that the Shift, Ctrl, and/or Alt keys should be held down while several other keys are pressed, enclose the key codes in parentheses ( ). For example, to have the Alt key held down while X and D are pressed, use "%(XD)". You could also use "%X%D", but if the Shift, Ctrl, and/or Alt keys need to be held down for a number of keystrokes, the parentheses can make the string shorter. Also, you would want to use the parentheses if the application detects the release of the Shift, Ctrl, and/or Alt keys and that is not desired.
The following characters have special meaning in the keystroke parameter, so they must be enclosed inside braces ({ }). Some of these special characters have not been explained yet.
Special Character | Example | Special Character | Example |
+ (plus) | {+} | ^ (caret) | {^} |
% (percent) | {%} | ~ (tilde) | {~} |
< (less than) | {<} | > (greater than) | {>} |
[ (left sq. bracket) | {[} | ] (right sq. bracket) | {]} |
( (left paren) | {(} | ) (right paren) | {)} |
{ (left brace) | {{} | } (right brace) | {}} |
@ (at-sign) | {@} |
To send characters that are not normally displayed when you press a key (such as Enter or Tab) and keys that represent actions rather than characters, use the following special codes:
Key | Code | Key | Code |
Backspace | {BACKSPACE} or {BS} | Break | {BREAK} |
Caps Lock | {CAPSLOCK} | Clear | {CLEAR} |
Del | {DELETE} or {DEL} | Down Arrow | {DOWN} |
End | {END} | Enter | {ENTER} or ~ |
Esc | {ESCAPE} or {ESC} | Help | {HELP} |
Home | {HOME} | Ins | {INSERT} |
Left Arrow | {LEFT} | Num Lock | {NUMLOCK} |
Page Down | {PGDN} | Page Up | {PGUP} |
Print Screen | {PRTSC} | Right Arrow | {RIGHT} |
Scroll Lock | {SCROLLLOCK} | Tab | {TAB} |
Up Arrow | {UP} | F1 through F16 | {F1} through {F16} |
You can also specify that a key is to repeat itself a certain number of times, without repeating the key itself in the string. To repeat a keystroke, use the format:
{keystroke number}
Where "keystroke" is the key to repeat, followed by a single space, then the number of times to repeat the key.
For example, to press the down arrow key eight times, use "{DOWN 8}".
To type thirty asterisks (*), use "{* 30}".
Under some circumstances, it may be necessary to pause for a specific time before sending keystrokes to allow a program operation to complete. This is usually necessary when a program ignores keystrokes that have been queued while a long operation takes place (perhaps generating print output, rewinding a tape, performing a complex calculation, etc.).
Within the keystroke list, you can specify pauses by using the special {PAUSE #} keystroke.
This is not actually a keystroke, in that it does not press any key, but it can be included anywhere within the keystroke list. It will pause the specified number of seconds.
For example, the following keystroke list will press Alt-F, P, wait 10 seconds, then press Alt-F, X:
<%FP{PAUSE 10}%FX>
You can specify multiple pauses in the keystroke list if necessary.
The following example, will start Microsoft Word, load a file, print it, then exit.
rexec win95 "<%FO\docs\invoice.doc~%FP~%FX>" word
The keystrokes are:
Keystroke String | Sent | Description |
%F | Alt-F | Drops down the file menu |
O | O | Selects Open |
\docs\invoice.doc | \docs\invoice.doc | Types the filename. |
~ | Enter | Loads the File |
%F | Alt-F | Drops down the file menu |
P | P | Selects Print |
~ | Enter | Accepts the defaults on the Print dialog box |
%F | Alt-F | Drops down the file menu |
X | X | Selects eXit and Word exits |
Note that if this example were being run from a Unix system, you would have to use two backslashes (\\) for every one desired backslash because the Unix shells interpret the backslashes as special characters. The command would then be:
rexec win95 "<%FO\\docs\\invoice.doc~%FP~%FX>" word
If your keystroke strings get rather long or complex, you can store them in a keystroke macro file so you do not have to specify all of them each time you use the rexec command.
To create a keystroke macro file, you must use a text editor (or a word processor, but be sure to save as an ASCII file). Enter the keystrokes as you would on the rexec command line, with the following exceptions/reminders:
· Do not enter "<" as the first character in the file or ">" as the last character. All of the characters you enter in the file will be sent.
· You may press Enter in the file to enter the keystrokes on multiple lines. The line breaks have no effect on the keystrokes. They will be treated as if they were entered all on the same line. That is, you must remember to still use "~" or "{ENTER}" to "press" the Enter key. Pressing Enter in the file will not send the Enter key.
· You cannot nest keystroke macros. Your macro file cannot contain references to other keystroke macro files.
· The keystroke macro file must reside on the system running Winsock REXECD/95. You can create the file on that system or use rcp to copy it to that system before executing the command.
To use a keystroke macro file, enter the at-sign (@) followed by the filename in braces ({ }) where you would normally specify keystrokes on the rexec command line.
You will most likely need to specify a full pathname of the keystroke file on the system running Winsock REXECD/95, unless you know the working directory of Winsock REXECD/95 on the system running it and the keystroke macro resides in that directory. You may use forward slashes (/) instead of backslashes if you wish; this makes life easier for Unix users because the shell interprets the backslash characters.
For example, if you had a macro in the directory \kbmac\printss.mac on the system running Winsock REXECD/95, you could use it with this command:
rexec win95 "<@{/kbmac/printss.mac}>" excel
This would run "excel" on win95 and send the keystrokes stored in the file \kbmac\printss.mac to it.
You can intermix command line keystrokes and macro file keystrokes. That is, you can specify some of the keystrokes on the command line and use some from a macro file. You can also use multiple macro files.
For example, let's say we want to print a file using rexec through a Windows application called "wintiff". We want to store the keystrokes in a macro file, but do not want to store the filename in the macro file because it can change.
To do this you can store the first set of keystrokes in one macro file, specify the filename on the rexec command line, then store the remaining keystrokes in a second file.
For example, let's say the file is "mypic.tif":
rcp -x mypic.tif win95:/tmp
rexec win95 "<@{/kb/tif1.mac}\tmp\mypic.tif~@{/kb/tif2.mac}" wintiff
This example copies the file "mypic.tif" to the \tmp directory on win95. Then it runs "wintiff" and first sends the keystrokes from the file \kb\tif1.mac. That macro ends when "wintiff" requires a filename. The keystrokes to "type" the filename come from the rexec command line since the tif1.mac has ended. Then it continues by sending the keystrokes in the file \kb\tif2.mac. That is:
@{/kb/tif1.mac} | Send keystrokes from \kb\tif1.mac |
\tmp\mypic.tif~ | Type \tmp\mypic.tif and press Enter |
@{/kb/tif2.mac} | Send keystrokes from \kb\tif2.mac |
Winsock REXECD/95 also allows you to specify the window type of the application being run. Normally, the application is run based on the Default Window Type specified in the REXECD/95 Control Panel applet.
If you want to specify a different method of displaying the application's window, you can specify this inside the keystroke parameter by enclosing the method in square brackets ([ ]).
There are two methods of setting the window type. You can use one of the words shown below or you can use a number. The options are:
Window Option | Displays |
NORMAL or NORM | Normal Display as defined by the application |
MINIMIZE or MIN | Shows the application as a minimized icon without focus |
MINACTIVE or MINA | Shows the application as a minimized icon with focus |
MAXIMIZE or MAX | Maximizes the application on startup |
HIDE | Hides the application (no icon appears) |
0 | Same as HIDE |
1 | Same as NORMAL |
7 | Same as MINIMIZE |
2 | Same as MINACTIVE |
3 | Same as MAXIMIZE |
Other numeric values may be used - they correspond to the Windows' ShowWindow API call (for all you programmers).
For example, if you want to run the Windows Notepad maximized, viewing the file "heyyou.txt", you would type:
rexec win95 "<[MAXIMIZE]>%FOheyyou.txt~" notepad
This runs the Notepad maximized, then "presses" Alt-F-O (File Open) and types the filename "heyyou.txt" and presses Enter to load it.
If you wanted to run some application that does some task and exits, you could run it minimized using:
rexec win95 "<[MINIMIZE]>" bkgprint
Note that Windows does not allow you to send keystrokes to a minimized or hidden application. Therefore, "[MINIMIZE]", "[HIDE]", "[0]", or "[2]" should always appear alone between the "<" and ">". If you specify other keystrokes, the application will not receive them (Windows will beep at you for each keystroke).
SHUTTING DOWN AND REBOOTING WINDOWS THROUGH REXECD/95
REXECD/95 internally understands two special commands that allow you to remotely shutdown and reboot the Windows system through the rexec command. These commands require the special <[INTERNAL]> or <[INT]> indicators. The commands have the following syntax:
rexec win95 "<[INT]>" shutdown [#]
rexec win95 "<[INT]>" reboot [#]
The [#] are optional. You can specify a number of seconds to delay the shutdown or reboot in this parameter. If you do not specify a number of seconds, it is immediate.
For example:
rexec win95 "<[INT]>" shutdown 60
(Shutdown win95 in 1 minute)
COPYING FILES USING RCP ("RCP/X")
Winsock REXECD/95 also provides Remote Copy (RCP) Server capability. This allows you to copy files to and from a PC running Winsock REXECD/95 using a non-standard rcp command.
The standard rcp command uses the rsh protocol to initiate the connection to the host. Winsock REXECD/95 supports rcp copies from an rcp command that initiates the connection using the rexec protocol instead. This is
referred to as "RCP/X" in this documentation. Denicomp Systems has a version of the rcp command in its Winsock RCP/RSH/REXEC for Win32 package that supports the rexec protocol. This software works on Windows 95 and Windows NT systems only. For other operating systems, such as Unix, you would need to obtain source code for the rcp command and modify it to support rcp copies through rexec, so this capability may be of limited usefulness in that environment.
The difference between the standard rcp and "RCP/X" is that "RCP/X" will ask for a password; the standard rcp does not.
The following gives a few examples of how RCP/X is used, using Denicomp Systems' Winsock RCP/RSH/REXEC for Win32 package.
To copy a file from the host named "srvpc" to your PC or Unix system, use:
rcp -x srvpc:yourfile myfile
NOTE: The "-x" is a non-standard extension supported by Denicomp Systems' rcp command that tells rcp to use the rexec protocol instead of rsh.
The file "yourfile" is copied from the host named "srvpc" to the file on your PC named "myfile". The host "srvpc" could be running either Windows and Winsock REXECD/95 or Unix.
To copy a file from your PC or Unix system to the system named "srvpc", use:
rcp -x \lists\xmas.doc srvpc:\word\lists
The file \lists\xmas.doc is copied from your system to the file xmas.doc in the directory \word\lists on the system named "srvpc".
To send the entire directory tree from your PC or Unix system to "srvpc", use:
rcp -x -b -r \share srvpc:\
All of the files and subdirectories in the directory \share are copied to the system named "srvpc". It will create a \share directory in the root directory (\) of srvpc.
If the \share directory contained any subdirectories, they would be created on the other system and all the files in them would also be copied.
To copy all of the files ending with ".xls" from "srvpc" to your PC, use:
rcp -x -b srvpc:\sheets\*.xls .
This copies all of the files ending with ".xls" in the directory \sheets on "srvpc" to the current directory (.) on your PC.
You can use drive letters if necessary. For example, to copy a file from the A: drive on the "srvpc" to your PC:
rcp -x srvpc:a:file.txt file.txt
This will copy "file.txt" from the A: drive on "srvpc" to the file "file.txt" on your system.
NOTE: Winsock REXECD/95 allows you to use both slashes (/) and backslashes (\) for directory separators. It will adjust appropriately. This is especially important for Unix users, since backslashes are interpreted by the shell and must be escaped by using two backslashes for every one backslash. Use slashes instead.
Winsock REXECD/95 provides a method for you to have end-of-line characters automatically converted in files copied with rcp. Unix systems use a single newline (ASCII 10) character as a line delimiter. Windows systems use carriage return (ASCII 13) and newline pairs for line delimiters.
When end-of-line conversion is enabled, REXECD/95 will convert all carriage return/newline pairs to single newlines when files are copied from the Windows system. It will add a carriage return to every newline character when files are copied to the Windows system.
Winsock REXECD/95 includes two utilities that allow you to control the operation of the Winsock REXECD/95 service.
The first utility is wrexectl. This can be run in two ways. First, you can use the Service Control button in the Winsock REXECD/95 Control Panel applet. Or you can run it from the REXECD/95 installation directory.
To start it without using the Control Panel, use Start/Run, then type the name of the REXECD/95 installation directory (usually C:\WREXEC95), a backslash (\), then "wrexectl" (e.g. "C:\WREXEC95\WREXECTL"). Or you can get to a Windows DOS Prompt. Change to the directory where Winsock REXECD/95 is installed using the CD command, then type "wrexectl".
You can then do the following:
Start the Winsock REXECD/95 Service
This starts the Winsock REXECD/95 Service if it is not currently running.
Stop the Winsock REXECD/95 Service
This stops the Winsock REXECD/95 Service if it is currently running. This is useful
when you have changed the Winsock REXECD/95 configuration. Stopping and restarting Winsock
REXECD/95 will cause it to re-read the configuration options.
Install the Winsock REXECD/95 Service
This installs the Winsock REXECD/95 Service in the Windows list of services. It does not
install the files from the Winsock REXECD/95 diskette. It only adds Winsock REXECD/95 to
the list of services that Windows will execute.
Remove the Winsock REXECD/95 Service
This removes the Winsock REXECD/95 Service from the Windows list of services. It does not
delete any files. It only removes it from the list of services. Use the Install option to
add it to the list again.
Why does it sometimes take a few seconds for REXECD/95 to execute a program from an rexec or to copy a file from an rcp command?
This could be due to one of two things. First, it could be due to a slow or inaccessible DNS server if you are using DNS. If you enter a filename in the Security File, Message Log, Request Log, Deny Log, or Error Log fields in the REXECD/95 Control Panel applet, REXECD/95 will attempt to obtain a hostname for the client based on its IP address. If you have specified DNS server(s) in your TCP/IP setup, it will attempt to use them to obtain the hostname. Otherwise, it will use the HOSTS file (e.g. c:\windows\hosts).
If the DNS server is down, inaccessible, or simply does not know a hostname for the client's IP address, there could be a long delay before this is determined. If this is the case, there are a few things you can do to resolve the problem:
HKEY_LOCAL_MACHINE\SOFTWARE\DenicompSystems\WREXECD95\Setup\DisableHostLookup
Create this as a new String Value and set it to a value of "1". This will disable the look up of the client's hostname. However, you will then only see IP addresses in the logs and you may only use IP addresses (no hostnames) in the Security File when this is set to 1.
The second possible cause is not as simple to explain. It is due to a missing "feature" in the Windows TCP/IP implementation. Often, your first rexec will be fast, then subsequent commands will be delayed by a few seconds. This delay is not caused by REXECD/95. It takes Windows a few seconds at times to notify REXECD/95 that there is a connection waiting. REXECD/95 processes the request very quickly once it is notified.
To illustrate this, restart your Windows system, then issue an rexec command from another system to the Windows system. It will be quick. Then immediately issue another rexec; it will be delayed by a few seconds.
The root of this problem can be explained somewhat, although technical. After you issue the first rexec, the TCP/IP connection (a "socket") is closed and it goes into the TIME_WAIT state, which is normal. You can see this by typing the netstat command on the Windows system after you do an rexec to it.
As long as there are closed sockets in the TIME_WAIT state which were created by REXECD/95, you will experience the delay. It takes up to four minutes (a TCP/IP constant) for them to go out of the TIME_WAIT state. Once they do, the next rexec will be quick. Then the cycle repeats; you need to wait another four minutes for it to be quick again.
The reason for this is that the Windows TCP/IP stack is strictly RFC compliant regarding the TIME_WAIT socket state. Most UNIX TCP/IP stacks, which are derived from BSD, have a non-standard-extension dealing with the TIME_WAIT state and new connections.
BSD-derived stacks allow a new connection request to arrive for a connection that is in the TIME_WAIT state if the new sequence number is greater than the final sequence number from the previous incarnation of the connection. Usually the sequence number for the new incarnation is set to the final sequence number from the previous incarnation plus 128,000.
This feature allows a client and server continually reuse the same port number at each end for successive incarnations of the same connection, but only if the server does the active close, which is always the case with an rexecd (or rshd).
The Windows TCP/IP stack does not support this feature and this causes the delay sometimes experienced. The delay is at the TCP/IP stack level and not in Winsock REXECD/95, so there is no work-around that we can employ to resolve it. It would require a change to the Windows TCP/IP stack.
Since it only occurs on subsequent rexec commands during the TIME_WAIT interval, which is four (4) minutes by default under Windows, as long as there are at least four minutes between each rexec from the same client, the delay will not occur.
Support is available via e-mail through the Internet or Compuserve.
Internet: support@denicomp.com
WWW: http://www.denicomp.com
Compuserve: 71612,2333