Hi,
rsh executes the specified command on the remote host using the same user which executes the rsh command on the local host.
For example, if you are logged in as the user "john" and execute:
Code:
rsh remote_host "ls -lrt"
then the specified command (ls -lrt) will be executed on the machine "remote_host" using the remote user "john", which must exist on the remote machine.
Otherwise, you must provide the remote user with the "-l user" option:
Code:
rsh -l dave remote_host "ls -lrt"
You obtain "permission denied" because the remote host doesn't "trust" your local host, so it couldn't estabilish a connection. To correct the problem, you must create in the home directory of the remote user on the remote server a hidden file called ".rhosts", containing the ip address (or the hostname) of your local host. However, this mechanism is insecure. If you want a secure connection you must install and use a tool like ssh (secure shell).
Suppose you are the user "john" on your localhost 2.160.64.131 an you wish to connect to the remote host 2.160.64.130 with the same user (john). In this situation you must create the ".rhosts" file in the home directory of the user "john" on the server 2.160.64.130; in this file you have to simply put a line containing the ip address "2.160.64.131".
In addition you must ensure that the login is enabled for the user "john" on the remote host (i.e. the user account is not locked).
Bye bye