<s>
The	O
Berkeley	B-Application
r-commands	I-Application
are	O
a	O
suite	B-Application
of	O
computer	B-Application
programs	I-Application
designed	O
to	O
enable	O
users	O
of	O
one	O
Unix	B-Application
system	I-Application
to	O
log	O
in	O
or	O
issue	O
commands	B-Application
to	O
another	O
Unix	B-Application
computer	O
via	O
TCP/IP	B-Protocol
computer	B-Architecture
network	I-Architecture
.	O
</s>
<s>
The	O
r-commands	O
were	O
developed	O
in	O
1982	O
by	O
the	O
Computer	B-Operating_System
Systems	I-Operating_System
Research	I-Operating_System
Group	I-Operating_System
at	O
the	O
University	O
of	O
California	O
,	O
Berkeley	O
,	O
based	O
on	O
an	O
early	O
implementation	O
of	O
TCP/IP	B-Protocol
(	O
the	O
protocol	B-Protocol
stack	I-Protocol
of	O
the	O
Internet	O
)	O
.	O
</s>
<s>
The	O
CSRG	B-Operating_System
incorporated	O
the	O
r-commands	O
into	O
their	O
Unix	B-Application
operating	I-Application
system	I-Application
,	O
the	O
Berkeley	B-Operating_System
Software	I-Operating_System
Distribution	I-Operating_System
(	O
BSD	B-Operating_System
)	O
.	O
</s>
<s>
The	O
r-commands	O
premiered	O
in	O
BSD	B-Operating_System
v4.1	O
.	O
</s>
<s>
Among	O
the	O
programs	O
in	O
the	O
suite	B-Application
are	O
:	O
(	O
remote	O
copy	B-Application
)	O
,	O
(	O
remote	O
execution	B-General_Concept
)	O
,	O
(	O
remote	O
login	B-General_Concept
)	O
,	O
(	O
remote	B-Protocol
shell	I-Protocol
)	O
,	O
,	O
,	O
and	O
(	O
remote	O
who	B-Application
)	O
.	O
</s>
<s>
The	O
r-commands	O
were	O
a	O
significant	O
innovation	O
,	O
and	O
became	O
de	O
facto	O
standards	O
for	O
Unix	B-Application
operating	I-Application
systems	I-Application
.	O
</s>
<s>
With	O
wider	O
public	O
adoption	O
of	O
the	O
Internet	O
,	O
their	O
inherent	O
security	O
vulnerabilities	O
became	O
a	O
problem	O
,	O
and	O
beginning	O
with	O
the	O
development	O
of	O
Secure	B-Protocol
Shell	I-Protocol
protocols	I-Protocol
and	O
applications	O
in	O
1995	O
,	O
its	O
adoption	O
entirely	O
supplanted	O
the	O
deployment	O
and	O
use	O
of	O
r-commands	O
(	O
and	O
Telnet	B-Protocol
)	O
on	O
networked	O
systems	O
.	O
</s>
<s>
+	O
Overview	O
Service	O
Port	B-Protocol
Transport	B-Architecture
Client	B-Protocol
Daemon	B-Operating_System
rcp	B-Application
rshd	B-Protocol
514	O
TCP	B-Protocol
rexec	B-Application
rexecd	O
512	O
TCP	B-Protocol
rlogin	B-Application
rlogind	O
513	O
TCP	B-Protocol
rsh	B-Protocol
rshd	B-Protocol
514	O
TCP	B-Protocol
rstat	O
rstatd	O
UDP	O
ruptime	O
rwhod	O
513	O
UDP	O
Casad	O
(	O
2008	O
)	O
,	O
pp	O
.	O
</s>
<s>
The	O
original	O
Berkeley	O
package	O
that	O
provides	O
rlogin	B-Application
also	O
features	O
rcp	B-Application
(	O
remote-copy	O
,	O
allowing	O
files	O
to	O
be	O
copied	O
over	O
the	O
network	O
)	O
and	O
rsh	B-Protocol
(	O
remote-shell	O
,	O
allowing	O
commands	B-Application
to	O
be	O
run	O
on	O
a	O
remote	O
machine	O
without	O
the	O
user	O
logging	O
into	O
it	O
)	O
.	O
</s>
<s>
These	O
share	O
the	O
hosts.equiv	O
and	O
.rhosts	O
access-control	O
scheme	O
(	O
although	O
they	O
connect	O
to	O
a	O
different	O
daemon	B-Operating_System
,	O
rshd	B-Protocol
)	O
.	O
</s>
<s>
enables	O
a	O
user	O
to	O
log	O
in	O
on	O
another	O
server	B-Application
via	O
computer	B-Architecture
network	I-Architecture
,	O
using	O
TCP	B-Protocol
network	B-Protocol
port	I-Protocol
513	O
.	O
</s>
<s>
rlogin	B-Application
is	O
also	O
the	O
name	O
of	O
the	O
application	B-Application
layer	I-Application
protocol	O
used	O
by	O
the	O
software	O
,	O
part	O
of	O
the	O
TCP/IP	B-Protocol
protocol	I-Protocol
suite	I-Protocol
.	O
</s>
<s>
RFC	O
1282	O
,	O
in	O
which	O
it	O
was	O
defined	O
,	O
states	O
:	O
"	O
The	O
rlogin	B-Application
facility	O
provides	O
a	O
remote-echoed	O
,	O
locally	O
flow-controlled	O
virtual	O
terminal	O
with	O
proper	O
flushing	O
of	O
output.	O
"	O
</s>
<s>
rlogin	B-Application
communicates	O
with	O
a	O
daemon	B-Operating_System
,	O
rlogind	O
,	O
on	O
the	O
remote	O
host	O
.	O
</s>
<s>
rlogin	B-Application
is	O
similar	O
to	O
the	O
Telnet	B-Protocol
command	B-Application
,	O
but	O
is	O
not	O
as	O
customizable	O
and	O
is	O
able	O
to	O
connect	O
only	O
to	O
Unix-like	B-Operating_System
hosts	O
.	O
</s>
<s>
rsh	B-Protocol
opens	O
a	O
shell	B-Operating_System
on	O
a	O
remote	O
computer	O
without	O
a	O
login	B-General_Concept
procedure	O
.	O
</s>
<s>
Once	O
connected	O
,	O
the	O
user	O
can	O
execute	O
commands	B-Application
on	O
the	O
remote	O
computer	O
through	O
the	O
shell	B-Operating_System
's	O
command-line	B-Application
interface	I-Application
.	O
</s>
<s>
rsh	B-Protocol
passes	O
input	O
and	O
output	O
through	O
the	O
standard	B-Operating_System
streams	I-Operating_System
,	O
and	O
it	O
sends	O
standard	O
output	O
to	O
the	O
user	O
's	O
console	B-Application
.	O
</s>
<s>
Over	O
the	O
network	O
,	O
standard	O
input	O
and	O
standard	O
out	O
flow	O
through	O
TCP	B-Protocol
port	I-Protocol
514	O
,	O
while	O
Standard	O
Error	O
flows	O
through	O
a	O
different	O
TCP	B-Protocol
port	I-Protocol
,	O
which	O
the	O
rsh	B-Protocol
daemon	I-Protocol
(	O
rshd	B-Protocol
)	O
opens	O
.	O
</s>
<s>
Like	O
rsh	B-Protocol
,	O
rexec	B-Application
enables	O
the	O
user	O
to	O
run	O
shell	B-Operating_System
commands	B-Application
on	O
a	O
remote	O
computer	O
.	O
</s>
<s>
However	O
,	O
unlike	O
the	O
rsh	B-Protocol
server	B-Application
,	O
the	O
rexec	B-Application
server	B-Application
(	O
rexecd	O
)	O
requires	O
login	B-General_Concept
:	O
it	O
authenticates	O
users	O
by	O
reading	O
the	O
username	O
and	O
password	O
(	O
unencrypted	O
)	O
from	O
the	O
network	B-Protocol
socket	I-Protocol
.	O
</s>
<s>
rexec	B-Application
uses	O
TCP	B-Protocol
port	I-Protocol
512	O
.	O
</s>
<s>
rcp	B-Application
can	O
copy	B-Application
a	O
file	O
or	O
directory	O
from	O
the	O
local	O
system	O
to	O
a	O
remote	O
system	O
,	O
from	O
a	O
remote	O
system	O
to	O
the	O
local	O
system	O
,	O
or	O
from	O
one	O
remote	O
system	O
to	O
another	O
.	O
</s>
<s>
The	O
command	B-Application
line	I-Application
arguments	O
of	O
cp	B-Application
and	O
rcp	B-Application
are	O
similar	O
,	O
but	O
in	O
rcp	B-Application
remote	O
files	O
are	O
prefixed	O
with	O
the	O
name	O
of	O
the	O
remote	O
system	O
:	O
</s>
<s>
As	O
with	O
the	O
Unix	B-Application
copy	B-Application
command	B-Application
cp	B-Application
,	O
rcp	B-Application
overwrites	O
an	O
existing	O
file	O
of	O
the	O
same	O
name	O
in	O
the	O
target	O
;	O
unlike	O
cp	B-Application
,	O
it	O
provides	O
no	O
mechanism	O
for	O
warning	O
the	O
user	O
before	O
overwriting	O
the	O
target	O
file	O
.	O
</s>
<s>
Like	O
rsh	B-Protocol
,	O
rcp	B-Application
uses	O
TCP	B-Protocol
port	I-Protocol
514	O
.	O
</s>
<s>
Just	O
as	O
the	O
who	B-Application
command	B-Application
lists	O
the	O
users	O
who	B-Application
are	O
logged	O
in	O
to	O
the	O
local	O
Unix	B-Application
system	I-Application
,	O
rwho	O
lists	O
those	O
users	O
who	B-Application
are	O
logged	O
into	O
all	O
multi-user	B-Operating_System
Unix	B-Application
systems	I-Application
on	O
the	O
local	O
network	O
.	O
</s>
<s>
rwho	O
's	O
daemon	B-Operating_System
,	O
rwhod	O
,	O
maintains	O
a	O
database	O
of	O
the	O
status	O
of	O
Unix	B-Application
systems	I-Application
on	O
the	O
local	O
network	O
.	O
</s>
<s>
The	O
daemon	B-Operating_System
and	O
its	O
database	O
are	O
also	O
used	O
by	O
the	O
ruptime	O
program	O
.	O
</s>
<s>
Just	O
as	O
the	O
command	B-Application
shows	O
how	O
long	O
a	O
Unix	B-Application
system	I-Application
has	O
been	O
running	O
since	O
the	O
last	O
restart	O
,	O
requests	O
a	O
status	O
report	O
from	O
all	O
computers	O
on	O
the	O
local	O
network	O
.	O
</s>
<s>
This	O
information	O
is	O
tracked	O
and	O
stored	O
by	O
the	O
daemon	B-Operating_System
rwhod	O
,	O
which	O
is	O
also	O
used	O
by	O
the	O
rwho	O
command	B-Application
.	O
</s>
<s>
Those	O
r-commands	O
which	O
involve	O
user	O
authentication	O
(	O
rcp	B-Application
,	O
rexec	B-Application
,	O
rlogin	B-Application
,	O
and	O
rsh	B-Protocol
)	O
share	O
several	O
serious	O
security	O
vulnerabilities	O
:	O
</s>
<s>
The	O
.rlogin	O
(	O
or	O
.rhosts	O
)	O
file	O
is	O
easy	O
to	O
misuse	O
.	O
</s>
<s>
They	O
are	O
designed	O
to	O
allow	O
logins	B-General_Concept
without	O
a	O
password	O
,	O
but	O
their	O
reliance	O
on	O
remote	O
usernames	O
,	O
hostnames	O
,	O
and	O
IP	O
addresses	O
is	O
exploitable	O
.	O
</s>
<s>
The	O
protocol	O
partly	O
relies	O
on	O
the	O
remote	O
party	O
's	O
rlogin	B-Application
client	B-Protocol
to	O
provide	O
information	O
honestly	O
,	O
including	O
source	O
port	B-Protocol
and	O
source	O
host	O
name	O
.	O
</s>
<s>
A	O
corrupt	O
client	B-Protocol
is	O
thus	O
able	O
to	O
forge	O
this	O
and	O
gain	O
access	O
,	O
as	O
the	O
rlogin	B-Application
protocol	O
has	O
no	O
means	O
of	O
authenticating	O
other	O
machines	O
 '	O
identities	O
,	O
or	O
ensuring	O
that	O
the	O
requesting	O
client	B-Protocol
on	O
a	O
trusted	O
machine	O
is	O
the	O
real	O
rlogin	B-Application
client	B-Protocol
.	O
</s>
<s>
The	O
common	O
practice	O
of	O
mounting	O
users	O
 '	O
home	O
directories	O
via	O
NFS	O
exposes	O
rlogin	B-Application
to	O
attack	O
by	O
means	O
of	O
fake	O
.rhosts	O
files	O
-	O
this	O
means	O
that	O
any	O
of	O
NFS	B-Protocol
's	I-Protocol
security	O
faults	O
automatically	O
plague	O
rlogin	B-Application
.	O
</s>
<s>
Due	O
to	O
these	O
problems	O
,	O
the	O
r-commands	O
fell	O
into	O
relative	O
disuse	O
(	O
with	O
many	O
Unix	B-Application
and	O
Linux	B-Application
distributions	O
no	O
longer	O
including	O
them	O
by	O
default	O
)	O
.	O
</s>
<s>
Many	O
networks	O
that	O
formerly	O
relied	O
on	O
rlogin	B-Application
and	O
telnet	B-Protocol
have	O
replaced	O
them	O
with	O
SSH	B-Protocol
and	O
its	O
rlogin-equivalent	O
slogin	B-Application
.	O
</s>
