Provided by Colasoft Co., Ltd.

RSH ( Remote Shell Protocol )

Home > Protocols > RSH Update: 2005-12-07 17:01:03    I have words to say about this protocol
On this page
SUMMARY
Protocol : Remote Shell Protocol
Protocol suite : TCP/IP
Layer : Application Layer
DESCRIPTION
RSH £¨Remote Shell Protocol Protocol£©allows a user to execute commands on a remote system without having to log in to the system. For example, RSH can be used to remotely examine the status of a number of access servers without connecting to each communication server, executing the command, and then disconnecting from the communication server.

RSH (remote shell) is a command line computer program which can execute shell commands as another user, and on another computer across a computer network. The remote system on which the RSH executes the command needs to be running the RSHD daemon.

RSH originated as part of the unix operating system, along with rcp, as part of the rlogin package on Berkeley Software Distribution version 4.2 in 1983. RSH has since been ported to other operating systems.

As described in the rlogin article, the rsh protocol is not secure for network use, because it sends unencrypted information over the network, among other things. Some implementations also authenticate by sending unencrypted passwords over the network. rsh has largely been replaced by the very similar SSH (secure shell) program on untrusted networks like the internet.

As an example of RSH use, the following executes the command mkdir testdir as user remote user on the computer remote computer:

rsh -l remote user remote computer "mkdir testdir"
After the command has finished RSH terminates. If no command is specified then rsh will log in on the remote system using rlogin.


RSH executes command on host
RSH copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rsh normally terminates when the remote command does. The options are as follows:
  • -d
    The -d option turns on socket debugging (using setsockopt(2)) on the TCP sockets used for communication with the remote host.


  • -l
    By default, the remote username is the same as the local username. The -l option allows the remote name to be specified.


  • -n
    The -n option redirects input from the special device /dev/null (see the BUGS section of this manual page).


If no command is specified, you will be logged in on the remote host using rlogin.

Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote machine. For example, the command
   rsh otherhost cat remotefile >> localfile


appends the remote file remotefile to the local file localfile, while
rsh otherhost cat remotefile ">>" other_remotefile

appends remotefile to other_remotefile.


Top of Page

EXAMPLES
Example 1


To check the amount of free disk space on a remote host (the local host, host1, is
listed in the /etc/hosts.equiv file at the remote host, host2), enter:

rsh host2 df

The amount of free disk space on host2 is displayed on the local system.
Example 2


To append a remote file to another file on the remote host, place the ¡°>>¡±
metacharacters in quotation marks (the local host, host1, is listed in the
/etc/hosts.equiv file at the remote host, host2), and enter:

rsh host2 cat test1 ">>" test2

The file test1 is appended to test2 on remote host host2.
Example 3


To append a remote file at the remote host to a local file ((the local host, host1, is
listed in the /etc/hosts.equiv file at the remote host, host2)), omit the quotation
marks, and enter:

rsh host2 cat test2 >> test3

The remote file test2 on host2 is appended to the local file test3.
Example 4


To append a remote file to a local file and use a remote user's permissions at the
remote host (the local host, host1, is listed in the /etc/hosts.equiv file at the
remote host, host2), enter:

rsh host2 -l jane cat test4 >> test5

The remote file test4 is appended to the local file test5 at the remote host, with user
jane's permissions.
Example 5


This example shows how the root user can issue an rcp on a remote host when the
authentication is Kerberos 4 on both the target and server. The root user must be in
the authentication database and must have already issued kinit on the local host.
The command is issued at the local host to copy the file, stuff, from node r05n07 to
node r05n05 on an SP.

/usr/lpp/ssp/rcmd/bin/rsh r05n07 'export KRBTKTFILE=/tmp/rcmdtkt$$;
/usr/lpp/ssp/rcmd/bin/rcmdtgt;
/usr/lpp/ssp/rcmd/bin/rcp /tmp/stuff r05n05:/tmp/stuff;'

The root user sets the KRBTKTFILE environment variable to the name of a temporary
ticket-cache file and then obtains a service ticket by issuing the rcmdtgt command.
The rcp uses the service ticket to authenticate from host r05n07 to host r05n05.

Top of Page


PROTOCOL RELATIONS
Parent layer
Child layer
TCP/UDP
RSH
Top of Page

GLOSSARY
Authentication
The process of identifying an individual, usually based on a username and password. In security systems, authentication is distinct from authorization , which is the process of giving individuals access to system objects based on their identity. Authentication merely ensures that the individual is who he or she claims to be, but says nothing about the access rights of the individual.

Command
Command is an instruction to a computer or device to perform a specific task. Commands come in different forms. They can be: special words (keywords) that a program understands, function keys
choices in a menu and buttons or other graphical objects on your screen

Every program that interacts with people responds to a specific set of commands. The set of commands and the syntax for entering them is called the user interface and varies from one program to another.

Daemon
Daemon is a process that runs in the background and performs a specified operation at predefined times or in response to certain events. The term daemon is a UNIX term, though many other operating systems provide support for daemons, though they're sometimes called other names. Windows, for example, refers to daemons as System Agents and services. Typical daemon processes include print spoolers, e-mail handlers, and other programs that perform administrative tasks for the operating system. The term comes from Greek mythology, where daemons were guardian spirits.

Login
Alternative spellings for login are log in and log on.

OS
The most important program that runs on a computer. Every general-purpose computer must have an operating system to run other programs. Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, and controlling peripheral devices such as disk drives and printers.

Password
A secret series of characters that enables a user to access a file, computer, or program. On multi-user systems, each user must enter his or her password before the computer will respond to commands. The password helps ensure that unauthorized users do not access the computer. In addition, data files and programs may require a password.

RSH
RSH (Remote shell) is one of an entire family of remote UNIX style commands. The UNIX copy command, cp, becomes rcp.

Rcp
Rcp is a command on UNIX operating systems that is used to remote copy a file. That is, to copy one or more files from one computer system to another. It typically uses the TCP/IP protocol, but can use kerberos for authentication.

Remote
In networks, remote refers to files, devices, and other resources that are not connected directly to your workstation. Resources at your workstation are considered local.

Rlogin
Rlogin (remote login) is a Unix command that allows an authorized user to login to other UNIX machines (hosts) on a network and to interact as if the user were physically at the host computer. Once logged in to the host, the user can do anything that the host has given permission for, such as read, edit, or delete files.

SSH
SSH (Secure Shell) is both a computer program and an associated network protocol designed for logging into and executing commands on a networked computer. Users of SSH can also use it for tunneling, forwarding arbitrary TCP ports and X11 connections over the resultant secure channel; and can transfer files using the associated SFTP or SCP protocols. An ssh server, by default, listens on the standard TCP port 22.

Unix
Unix or UNIX is a computer operating system originally developed in the 1960s and 1970s by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. Today's Unix systems are split into various branches, developed over time by AT&T, several other commercial vendors, as well as several non-profit organizations.

User
User is an individual who uses a computer. This includes expert programmers as well as novices. An end user is any individual who runs an application program.

Top of Page

REFERENCES


Top of Page

OTHER PROTOCOLS OF TCP/IP SUITE
AARP   RRP   RTP Video   RTP Audio   RTP   COPS   Gopher   HSRP   ICP   MPLS   IEEE 802.2   CIP   FTP - Data   FTP - Ctrl   IMAPS   IP Fragment   LDAPS   PUP   MSSQL   RSH   SQL   POP3s   RTELNET   RSVP   STP   VLAN   MSN   H.323   MSRDP   HTTPS   WINS   LPD   GTP   ICMPv6   POP   TELNET   H.225   VRRP   PIM   RARP   SAP   OSPF   RLOGIN   SCTP   SIP   RTCP   PPPoE   Mobile IP   IMAP3   WhoIs   SLP   NCP   PPTP   MGCP   LDAP   L2TP   Kerberos   IPv6   GRE   Ethernet SNAP   AFP   CIFS   IEEE 802.3   Finger   NBDGM   NetBEUI   NBSSN   ESP   EIGRP   EGP   DHCP   CGMP   CDP   BOOTP   AH   NBNS   EthernetII   ICQ   PPP   ARP   RIP   IPX   IGRP   IGMP   SSH   RPC   NetBIOS   TFTP   SNMP   SNA   SMB   RADIUS   NTP   NNTP   UDP   TCP   BGP   DNS   SOCKS   IMAP   RTSP   NFS   ICMP   IP   FTP   Telnet   POP3   SMTP   HTTP  
Search RFCs:

Advanced Search
Search Glossary:
Exact search
Fuzzy search


All Protocols
Submit a Request

Recommend an Article

 Layer 7 Application Layer
  AFP
  BOOTP
  CIFS
  CIP
  COPS
  DHCP
  DNS
  Finger
  FTP
  FTP - Ctrl
  FTP - Data
  Gopher
  HSRP
  HTTP
  HTTPS
  ICP
  ICQ
  IMAP
  IMAP3
  IMAPS
  Kerberos
  LPD
  MGCP
  MSN
  MSRDP
  MSSQL
  NCP
  NFS
  NNTP
  NTP
  POP
  POP3
  POP3s
  RADIUS
  RLOGIN
  RRP
  RSH
  RTCP
  RTELNET
  RTP
  RTP Audio
  RTP Video
  RTSP
  SAP
  SIP
  SLP
  SMB
  SMTP
  SNA
  SNMP
  SOCKS
  SSH
  Telnet
  TELNET
  TFTP
  WhoIs
  WINS
 Layer 6 Presentation Layer
  NBNS
  NBSSN
  NCP
  NetBIOS
 Layer 5 Session Layer
  LDAP
  LDAPS
  NCP
  NetBEUI
  RPC
 Layer 4 Transport Layer
  H.225
  H.323
  NBDGM
  NetBEUI
  PUP
  SCTP
  TCP
  UDP
 Layer 3 Network Layer
  AARP
  AH
  BGP
  EGP
  EIGRP
  ESP
  GRE
  GTP
  ICMP
  ICMPv6
  IGMP
  IGRP
  IP
  IP Fragment
  IPv6
  IPX
  Mobile IP
  MPLS
  OSPF
  PIM
  PPPoE
  RIP
  RSVP
  STP
  VRRP
 Layer 2 Data Link Layer
  ARP
  CDP
  CGMP
  Ethernet SNAP
  EthernetII
  IEEE 802.2
  IEEE 802.3
  L2TP
  PPP
  PPTP
  RARP
  SQL
  VLAN
 Layer 1 Physical Layer
© 2006 - 2007 Colasoft Co., Ltd. All rights reserved.