Contents
 Using Remote Command

Use Remote Command to execute commands in one of two formats on a remote host.

Introduction

What is Remote Command?

How To...

Execute a Command on a Remote Host Using RSH

Execute a Command on a Remote Host Using REXEC

Establish an Open-Ended Connection to a Remote Host

Close a Connection to a Remote Host

Troubleshoot Remote Command Problems


Execute a Command on a Remote Host Using RSH

1.	Double-click the Remote Command icon.

The Remote Command dialog box opens.

2.	Select the RSH option button in the Protocol panel.

3.	Enter the name of the remote host in the Server edit box.

4.	Enter your Local User ID.

5.	Enter your Remote User ID.

6.	Enter the command you want to execute in the Command edit box.

7.	Click Send.

The standard output (result) of the command you entered is displayed in the window. Use the vertical and horizontal scroll bars to view it.

Note: If you are denied access by the remote host, ask your administrator to enter the name of your PC in the remote machine's .hosts file.


Execute a command on a Remote Host Using REXEC

1.	Double-click the Remote Command icon.

The Remote Command dialog box opens.

2	Select the REXEC option button in the Protocol panel.

The Local User ID edit box is disabled.

3.	Enter the name of the remote host in the Server edit box.

4.	Enter a Remote User ID.

5.	Enter a password that provides you access to the remote host.

6.	Enter the command you want to execute in the Command edit box.

7.	Choose Send.

If the password is valid, the standard output (result) of the command you entered is displayed in the window. Use the vertical and horizontal scroll bars to view it. An error message is displayed if the password is invalid.


Establish an Open-Ended RSH Connection
Establish an Open-Ended Connection to a Remote Host

1.	Double-click the Remote Command icon.

The Remote Command dialog box opens.

2.	Select the RSH option button in the Protocol panel.

3.	Enter the name of the remote host in the Server edit box.

4.	Enter a Local User ID.

5.	Enter a Remote User ID.

6.	Enter CSH in the Command edit box.

7.	Choose Send.

A remote shell is established on the machine specified in the Server edit box. The Disconnect button is activated.

8.	Enter another command and click Send.

Standard output of the command is displayed in the window.

See Also:

How to Close a Connection to a Remote Host


Close a Connection to a Remote Host

1.	Establish an open-ended connection to a remote host.

The Disconnect button is activated.

2.	Choose Disconnect.

The connection to the remote host is closed.

See Also:

How to Establish an Open-Ended Connection to a Remote Host


What is Remote Command?

Remote Command allows you to use the RSH or REXEC protocols to execute a command native to a remote host on the remote host. For example, from your PC, you can send an ps command to a remote UNIX host to view the c of a processes running on that host.

When you enter a remote host name and a command in the Remote Command dialog box and click Send, a connection is established with the remote host. The information normally displayed on the terminal screen is displayed in the Remote Command dialog box. Commands you enter are executed on the remote host. Commands that require input keep the connection open. If no input is required, the connection is closed after a command executes. When a connection is open, the Disconnect button is activated.


Troubleshooting Remote Command Problems

To execute a remote command, you must connect to a remote server that can execute the command.  Most problems you encounter when executing a remote command occur in connecting to the server or not being authorized to execute the command on the remote server.

Problem	Possible Causes	Solution
Cannot reach host.	The remote host, the network, or part of the network is not working.	Ask your network administrator for the name of a working server.
Cannot find host.	Your computer cannot find an nternet address for the remote computer in its name service (NIS, DNS, or hosts file).	Use ping to make sure you can reach the remote computer. Ask your network administrator for the name of another server.
Permission denied.	You can use REXEC to access any host running the rexecd program, providing that the remote host has an entry for the specified remote user ID and the password is correct.	Make sure you typed you password correctly. Check with your system administrator to make sure you have a valid user account on the remote computer and that the rexecd program is running on the remote host.
	The RSH protocol on UNIX systems does not require you to enter a password to a remote host, providing that your local host is a trusted machine.	Check to see if the local host name is in the remote host's  /etc/hosts.equiv file or The local host (or local host and local user ID) is in the remote host's ~/.hosts  file. (This is the .hosts file in the user's home directory on the remote machine.)


Command Execution

Command execution on the remote host depends on the operating system in use. On UNIX hosts, commands are executed in the form of: csh -s command, where csh represents the remote user shell, -s instructs the command to take input from standard input, and command represents the command you typed in.


REXEC Protocol

The REXEC protocol requires you to enter a password to gain access to the remote host. You can use REXEC to access any host running the rexecd program, providing the remote host has an entry for the specified remote useri ID and the password is correct.


RSH Protocol

The RSH protocol on UNIX systems does not require you to enter a password to a remote host, providing that your local host is a trusted machine.


Are You Trusted?

On UNIX machines, your local host is considered trusted if:

•	The specified user ID has no password on the remote host.

•	The host name of your PC is in the remote host's  /etc/hosts.equiv file.

•	The local host (or local host and local userid) is in the remote host's ~/.hosts file. (This is the .hosts file in the users home directory on the remote machine.)