|
|
Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00): HP 3000 MPE/iX Computer Systems > Chapter 10 Technical Articles The REMSH Client Functionality |
|
by Cas Caswell Commercial Systems Division The remote shell, or REMSH, service is used to connect to a specified host and execute a command on that remote host. This article describes:
REMSH is the same service as rsh on BSD UNIX systems. The name was changed due to a conflict with the existing command rsh (restricted shell) on System V UNIX systems. REMSH allows a user to connect to the remote system and execute a command on that remote system. Output from the remote command is sent to the REMSH standard output so the user can see the results of the command. The REMSH client is part of the Internet Services product with release C.55.03. To verify that REMSH is available on your system, use NMMAINT,73 to list versions of the Internet Services. There is only one file on the MPE/iX system that you will need to change in order to allow use of the REMSH client. That is the file services.net.sys. However, there are some files that will need to be configured on the remote UNIX systems. The services file associates official service names and aliases with the port number and protocol the services use. To enable REMSH use, you must edit the services file. To edit the services file:
The REMSH service does not prompt for user ID and passwords. That information is handled via the command line parameters and configuration on the UNIX host. See the using REMSH section for details on how the user id is determined and passed to the UNIX host. Password information is bypassed by use of a .rhosts file in the remote user's home directory or by use of the file /etc/hosts.equiv. See the man pages of the UNIX system for details on how to set up a /etc/hosts.equiv file. A user's .rhosts file entry will consist of the MPE/iX system name and user id. For example, to access the HP-UX system "taltos" as user "cawti," from the MPE/iX system "jhereg" while user MANAGER.SYS, set up a host equivalency via the /etc/hosts.equiv file, or you will create a .rhosts file in the home directory of user "cawti" on the "taltos" machine. The .rhosts file would look like this:
This will cause the REMSH daemon on the UNIX host to allow a connection from MANAGER.SYS on "jhereg" to the "cawti" user on the host "taltos." The .rhosts file for user "cawti" would contain an entry for every host and userid that you desired to access the "taltos" host as if they were the user "cawti."
The REMSH service is accessed by running the REMSH.NET.SYS program. You may do so under the MPE/iX CI or under the Posix shell. While the format of the commands will differ depending on how you run the program, the parameter list remains the same. We'll first look at the parameters and then look at running the program under the Posix Shell or from MPE/iX CI. For the purposes of explaining the parameters, look at a sample invocation from the Posix shell. Detailed examples of both the Posix shell and MPE/iX invocations will follow later. From the Posix shell you would invoke the REMSH by typing:
In all cases you must provide a remotehost and a remotecommand. The REMSH program will fail and generate an error message otherwise. Unless the remote system has MPE/iX type userids, you will also need to provide a -l remoteuser parameter as well. Otherwise the remote system will not allow the connection.
To run REMSH from MPE/iX prompt, type:
From the Posix Shell prompt, type:
Since you are running under the Posix shell, there are a number of shell features that you can take advantage of. Shell metacharacters that are not quoted are interpreted on the local host; quoted metacharacters are interpreted on the remote host. The following command line appends the remotefile to the local file localfile:
The following command line appends remotefile to the otherremotefile:
The following command line runs REMSH in the background on the local system, and the output of the remote command comes to your terminal asynchronously:
The following command line causes REMSH to return immediately without waiting for the remote command to complete:
In REMSH, if the first parameter in its argument vector is not REMSH, it will use the value as a host name. You may symbolically link the host name to the REMSH program. A typical BSD UNIX implementation will have these links under the /usr/hosts directory. If you have made a symbolic link to the REMSH program that is the host name (that is in our examples, ln -s /SYS/NET/REMSH taltos), you could generate the same result as the first example with the following:
These are the REMSH messages with an explanation of the meaning and suggested action, if any. Message
Meaning Be sure to provide a command to execute. Message
Meaning There is probably an invalid entry in remote .rhosts file. Be sure host name and userid are correct. Userid must be in upper case. Be sure you provided an -l userid parameter, or that the remote system has a userid that matches your MPE/iX logon. Message
Meaning The first message is from running REMSH from MPE/iX name space, and the second is from running under the Posix Shell. The cause is typically lack of PM capability on the group where REMSH resides. Since REMSH is in NET.SYS, it is unlikely you will see this problem unless someone changes the capability of the NET.SYS group. Message
Meaning The shell service specification is not present in the services file. Edit /etc/services or SERVICES.NET.SYS to fix. Message
Meaning REMSH cannot establish secondary socket connection for stderr. Message
Meaning The remote command tried to reopen stderror. This is not allowed under REMSH. Message
Meaning Error in executing system call. Appended to this error is a message specifying the cause of the failure. The full remote shell service typically consists of two parts: the REMSH client which allows a user on this machine to access remote hosts, and the remshd server which allows REMSH clients on other hosts to access the local host. Only the REMSH client functionality has been implemented on the MPE/iX system. The HP-UX version of the REMSH client has an optional -n parameter that tells the client to not read from STDIN. Due to differences between MPE IO and UNIX IO the -n parameter has been hard coded into the MPE/iX client. The HP-UX REMSH client also allows rlogin and rexec functionality. Since this implementation was designed to address the needs of users attempting to access HP-UX commands and scripts from MPE/iX stream jobs, we chose not to implement any feature needing interactive input with the remote system. |
|