1ae771770SStanislav Sedov.\" Copyright (c) 2002 - 2003 Kungliga Tekniska Högskolan 2bbd80c28SJacques Vidrine.\" (Royal Institute of Technology, Stockholm, Sweden). 3bbd80c28SJacques Vidrine.\" All rights reserved. 4bbd80c28SJacques Vidrine.\" 5bbd80c28SJacques Vidrine.\" Redistribution and use in source and binary forms, with or without 6bbd80c28SJacques Vidrine.\" modification, are permitted provided that the following conditions 7bbd80c28SJacques Vidrine.\" are met: 8bbd80c28SJacques Vidrine.\" 9bbd80c28SJacques Vidrine.\" 1. Redistributions of source code must retain the above copyright 10bbd80c28SJacques Vidrine.\" notice, this list of conditions and the following disclaimer. 11bbd80c28SJacques Vidrine.\" 12bbd80c28SJacques Vidrine.\" 2. Redistributions in binary form must reproduce the above copyright 13bbd80c28SJacques Vidrine.\" notice, this list of conditions and the following disclaimer in the 14bbd80c28SJacques Vidrine.\" documentation and/or other materials provided with the distribution. 15bbd80c28SJacques Vidrine.\" 16bbd80c28SJacques Vidrine.\" 3. Neither the name of the Institute nor the names of its contributors 17bbd80c28SJacques Vidrine.\" may be used to endorse or promote products derived from this software 18bbd80c28SJacques Vidrine.\" without specific prior written permission. 19bbd80c28SJacques Vidrine.\" 20bbd80c28SJacques Vidrine.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 21bbd80c28SJacques Vidrine.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22bbd80c28SJacques Vidrine.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23bbd80c28SJacques Vidrine.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 24bbd80c28SJacques Vidrine.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25bbd80c28SJacques Vidrine.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26bbd80c28SJacques Vidrine.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27bbd80c28SJacques Vidrine.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28bbd80c28SJacques Vidrine.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29bbd80c28SJacques Vidrine.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30bbd80c28SJacques Vidrine.\" SUCH DAMAGE. 31bbd80c28SJacques Vidrine.\" 32ae771770SStanislav Sedov.\" $Id$ 334137ff4cSJacques Vidrine.\" 34c19800e8SDoug Rabson.Dd February 20, 2004 354137ff4cSJacques Vidrine.Dt RSH 1 364137ff4cSJacques Vidrine.Os HEIMDAL 374137ff4cSJacques Vidrine.Sh NAME 384137ff4cSJacques Vidrine.Nm rsh 39ae771770SStanislav Sedov.Nd remote shell 404137ff4cSJacques Vidrine.Sh SYNOPSIS 414137ff4cSJacques Vidrine.Nm 424137ff4cSJacques Vidrine.Op Fl 45FGKdefnuxz 434137ff4cSJacques Vidrine.Op Fl U Pa string 444137ff4cSJacques Vidrine.Op Fl p Ar port 454137ff4cSJacques Vidrine.Op Fl l Ar username 460cadf2f4SJacques Vidrine.Op Fl P Ar N|O 474137ff4cSJacques Vidrine.Ar host [command] 484137ff4cSJacques Vidrine.Sh DESCRIPTION 494137ff4cSJacques Vidrine.Nm 504137ff4cSJacques Vidrineauthenticates to the 514137ff4cSJacques Vidrine.Xr rshd 8 524137ff4cSJacques Vidrinedaemon on the remote 534137ff4cSJacques Vidrine.Ar host , 544137ff4cSJacques Vidrineand then executes the specified 554137ff4cSJacques Vidrine.Ar command . 564137ff4cSJacques Vidrine.Pp 574137ff4cSJacques Vidrine.Nm 584137ff4cSJacques Vidrinecopies its standard input to the remote command, and the standard 594137ff4cSJacques Vidrineoutput and error of the remote command to its own. 604137ff4cSJacques Vidrine.Pp 614137ff4cSJacques VidrineValid options are: 624137ff4cSJacques Vidrine.Bl -tag -width Ds 634137ff4cSJacques Vidrine.It Xo 648373020dSJacques Vidrine.Fl 4 , 65ae771770SStanislav Sedov.Fl Fl krb4 664137ff4cSJacques Vidrine.Xc 674137ff4cSJacques VidrineThe 684137ff4cSJacques Vidrine.Fl 4 694137ff4cSJacques Vidrineoption requests Kerberos 4 authentication. Normally all supported 704137ff4cSJacques Vidrineauthentication mechanisms will be tried, but in some cases more 714137ff4cSJacques Vidrineexplicit control is desired. 724137ff4cSJacques Vidrine.It Xo 738373020dSJacques Vidrine.Fl 5 , 74ae771770SStanislav Sedov.Fl Fl krb5 754137ff4cSJacques Vidrine.Xc 764137ff4cSJacques VidrineThe 774137ff4cSJacques Vidrine.Fl 5 784137ff4cSJacques Vidrineoption requests Kerberos 5 authentication. This is analogous to the 794137ff4cSJacques Vidrine.Fl 4 804137ff4cSJacques Vidrineoption. 814137ff4cSJacques Vidrine.It Xo 828373020dSJacques Vidrine.Fl K , 83ae771770SStanislav Sedov.Fl Fl broken 844137ff4cSJacques Vidrine.Xc 854137ff4cSJacques VidrineThe 864137ff4cSJacques Vidrine.Fl K 87c19800e8SDoug Rabsonoption turns off all Kerberos authentication. The security in this 88c19800e8SDoug Rabsonmode relies on reserved ports. The long name is an indication of how 89c19800e8SDoug Rabsongood this is. 904137ff4cSJacques Vidrine.It Xo 918373020dSJacques Vidrine.Fl n , 92ae771770SStanislav Sedov.Fl Fl no-input 934137ff4cSJacques Vidrine.Xc 944137ff4cSJacques VidrineThe 954137ff4cSJacques Vidrine.Fl n 964137ff4cSJacques Vidrineoption directs the input from the 974137ff4cSJacques Vidrine.Pa /dev/null 984137ff4cSJacques Vidrinedevice (see the 994137ff4cSJacques Vidrine.Sx BUGS 1004137ff4cSJacques Vidrinesection of this manual page). 101c19800e8SDoug Rabson.It Fl d 102c19800e8SDoug RabsonEnable 103c19800e8SDoug Rabson.Xr setsockopt 2 104c19800e8SDoug Rabsonsocket debugging. 1054137ff4cSJacques Vidrine.It Xo 1068373020dSJacques Vidrine.Fl e , 107ae771770SStanislav Sedov.Fl Fl no-stderr 1084137ff4cSJacques Vidrine.Xc 1094137ff4cSJacques VidrineDon't use a separate socket for the stderr stream. This can be 1104137ff4cSJacques Vidrinenecessary if rsh-ing through a NAT bridge. 1114137ff4cSJacques Vidrine.It Xo 1128373020dSJacques Vidrine.Fl x , 113ae771770SStanislav Sedov.Fl Fl encrypt 1144137ff4cSJacques Vidrine.Xc 1154137ff4cSJacques VidrineThe 1164137ff4cSJacques Vidrine.Fl x 1174137ff4cSJacques Vidrineoption enables encryption for all data exchange. This is only valid 1184137ff4cSJacques Vidrinefor Kerberos authenticated connections (see the 1194137ff4cSJacques Vidrine.Sx BUGS 1204137ff4cSJacques Vidrinesection for limitations). 1214137ff4cSJacques Vidrine.It Xo 1224137ff4cSJacques Vidrine.Fl z 1234137ff4cSJacques Vidrine.Xc 1244137ff4cSJacques VidrineThe opposite of 1254137ff4cSJacques Vidrine.Fl x . 126c19800e8SDoug RabsonThis is the default, and is mainly useful if encryption has been 127c19800e8SDoug Rabsonenabled by default, for instance in the 128c19800e8SDoug Rabson.Li appdefaults 129c19800e8SDoug Rabsonsection of 130c19800e8SDoug Rabson.Pa /etc/krb5.conf 131c19800e8SDoug Rabsonwhen using Kerberos 5. 1324137ff4cSJacques Vidrine.It Xo 1338373020dSJacques Vidrine.Fl f , 134ae771770SStanislav Sedov.Fl Fl forward 1354137ff4cSJacques Vidrine.Xc 136c19800e8SDoug RabsonForward Kerberos 5 credentials to the remote host. 137c19800e8SDoug RabsonAlso settable via 138c19800e8SDoug Rabson.Li appdefaults 139c19800e8SDoug Rabson(see 140c19800e8SDoug Rabson.Xr krb5.conf ) . 1414137ff4cSJacques Vidrine.It Xo 1428373020dSJacques Vidrine.Fl F , 143ae771770SStanislav Sedov.Fl Fl forwardable 1444137ff4cSJacques Vidrine.Xc 145c19800e8SDoug RabsonMake the forwarded credentials re-forwardable. 146c19800e8SDoug RabsonAlso settable via 147c19800e8SDoug Rabson.Li appdefaults 148c19800e8SDoug Rabson(see 149c19800e8SDoug Rabson.Xr krb5.conf ) . 150c19800e8SDoug Rabson.It Xo 151c19800e8SDoug Rabson.Fl l Ar string , 152ae771770SStanislav Sedov.Fl Fl user= Ns Ar string 153c19800e8SDoug Rabson.Xc 154c19800e8SDoug RabsonBy default the remote username is the same as the local. The 155c19800e8SDoug Rabson.Fl l 156c19800e8SDoug Rabsonoption or the 157c19800e8SDoug Rabson.Pa username@host 158c19800e8SDoug Rabsonformat allow the remote name to be specified. 159c19800e8SDoug Rabson.It Xo 160c19800e8SDoug Rabson.Fl n , 161ae771770SStanislav Sedov.Fl Fl no-input 162c19800e8SDoug Rabson.Xc 163c19800e8SDoug RabsonDirect input from 164c19800e8SDoug Rabson.Pa /dev/null 165c19800e8SDoug Rabson(see the 166c19800e8SDoug Rabson.Sx BUGS 167c19800e8SDoug Rabsonsection). 168c19800e8SDoug Rabson.It Xo 169c19800e8SDoug Rabson.Fl p Ar number-or-service , 170ae771770SStanislav Sedov.Fl Fl port= Ns Ar number-or-service 171c19800e8SDoug Rabson.Xc 172c19800e8SDoug RabsonConnect to this port instead of the default (which is 514 when using 173c19800e8SDoug Rabsonold port based authentication, 544 for Kerberos 5 and non-encrypted 174*fc55c203SCy SchubertKerberos 4, and 545 for encrypted Kerberos 4; subject of course to 175c19800e8SDoug Rabsonthe contents of 176c19800e8SDoug Rabson.Pa /etc/services ) . 177c19800e8SDoug Rabson.It Xo 178c19800e8SDoug Rabson.Fl P Ar N|O|1|2 , 179ae771770SStanislav Sedov.Fl Fl protocol= Ns Ar N|O|1|2 180c19800e8SDoug Rabson.Xc 181c19800e8SDoug RabsonSpecifies the protocol version to use with Kerberos 5. 182c19800e8SDoug Rabson.Ar N 183c19800e8SDoug Rabsonand 184c19800e8SDoug Rabson.Ar 2 185c19800e8SDoug Rabsonselect protocol version 2, while 186c19800e8SDoug Rabson.Ar O 187c19800e8SDoug Rabsonand 188c19800e8SDoug Rabson.Ar 1 189c19800e8SDoug Rabsonselect version 1. Version 2 is believed to be more secure, and is the 190c19800e8SDoug Rabsondefault. Unless asked for a specific version, 191c19800e8SDoug Rabson.Nm 192c19800e8SDoug Rabsonwill try both. This behaviour may change in the future. 1934137ff4cSJacques Vidrine.It Xo 1948373020dSJacques Vidrine.Fl u , 195ae771770SStanislav Sedov.Fl Fl unique 1964137ff4cSJacques Vidrine.Xc 1974137ff4cSJacques VidrineMake sure the remote credentials cache is unique, that is, don't reuse 1984137ff4cSJacques Vidrineany existing cache. Mutually exclusive to 1994137ff4cSJacques Vidrine.Fl U . 2004137ff4cSJacques Vidrine.It Xo 2018373020dSJacques Vidrine.Fl U Pa string , 202ae771770SStanislav Sedov.Fl Fl tkfile= Ns Pa string 2034137ff4cSJacques Vidrine.Xc 2044137ff4cSJacques VidrineName of the remote credentials cache. Mutually exclusive to 2054137ff4cSJacques Vidrine.Fl u . 2064137ff4cSJacques Vidrine.It Xo 207c19800e8SDoug Rabson.Fl x , 208ae771770SStanislav Sedov.Fl Fl encrypt 2094137ff4cSJacques Vidrine.Xc 210c19800e8SDoug RabsonThe 211c19800e8SDoug Rabson.Fl x 212c19800e8SDoug Rabsonoption enables encryption for all data exchange. This is only valid 213c19800e8SDoug Rabsonfor Kerberos authenticated connections (see the 214c19800e8SDoug Rabson.Sx BUGS 215c19800e8SDoug Rabsonsection for limitations). 216c19800e8SDoug Rabson.It Fl z 217c19800e8SDoug RabsonThe opposite of 218c19800e8SDoug Rabson.Fl x . 219c19800e8SDoug RabsonThis is the default, but encryption can be enabled when using 220c19800e8SDoug RabsonKerberos 5, by setting the 221c19800e8SDoug Rabson.Li libdefaults/encrypt 222c19800e8SDoug Rabsonoption in 223c19800e8SDoug Rabson.Xr krb5.conf 5 . 2244137ff4cSJacques Vidrine.El 2254137ff4cSJacques Vidrine.\".Pp 2264137ff4cSJacques Vidrine.\"Without a 2274137ff4cSJacques Vidrine.\".Ar command 2284137ff4cSJacques Vidrine.\".Nm 2294137ff4cSJacques Vidrine.\"will just exec 2304137ff4cSJacques Vidrine.\".Xr rlogin 1 2314137ff4cSJacques Vidrine.\"with the same arguments. 2324137ff4cSJacques Vidrine.Sh EXAMPLES 2334137ff4cSJacques VidrineCare should be taken when issuing commands containing shell meta 2340cadf2f4SJacques Vidrinecharacters. Without quoting, these will be expanded on the local 2354137ff4cSJacques Vidrinemachine. 2364137ff4cSJacques Vidrine.Pp 2374137ff4cSJacques VidrineThe following command: 2384137ff4cSJacques Vidrine.Pp 239c19800e8SDoug Rabson.Dl rsh otherhost cat remotefile \*[Gt] localfile 2404137ff4cSJacques Vidrine.Pp 2414137ff4cSJacques Vidrinewill write the contents of the remote 2424137ff4cSJacques Vidrine.Pa remotefile 2434137ff4cSJacques Vidrineto the local 2444137ff4cSJacques Vidrine.Pa localfile , 2454137ff4cSJacques Vidrinebut: 2464137ff4cSJacques Vidrine.Pp 247c19800e8SDoug Rabson.Dl rsh otherhost 'cat remotefile \*[Gt] remotefile2' 2484137ff4cSJacques Vidrine.Pp 2494137ff4cSJacques Vidrinewill write it to the remote 2504137ff4cSJacques Vidrine.Pa remotefile2 . 2514137ff4cSJacques Vidrine.\".Sh ENVIRONMENT 2524137ff4cSJacques Vidrine.Sh FILES 2534137ff4cSJacques Vidrine.Bl -tag -width /etc/hosts -compact 2544137ff4cSJacques Vidrine.It Pa /etc/hosts 2554137ff4cSJacques Vidrine.El 2564137ff4cSJacques Vidrine.\".Sh DIAGNOSTICS 2574137ff4cSJacques Vidrine.Sh SEE ALSO 2584137ff4cSJacques Vidrine.Xr rlogin 1 , 2594137ff4cSJacques Vidrine.Xr krb_realmofhost 3 , 2604137ff4cSJacques Vidrine.Xr krb_sendauth 3 , 2614137ff4cSJacques Vidrine.Xr hosts.equiv 5 , 2624137ff4cSJacques Vidrine.Xr krb5.conf 5 , 2634137ff4cSJacques Vidrine.Xr rhosts 5 , 2644137ff4cSJacques Vidrine.Xr kerberos 8 2654137ff4cSJacques Vidrine.Xr rshd 8 2664137ff4cSJacques Vidrine.\".Sh STANDARDS 2674137ff4cSJacques Vidrine.Sh HISTORY 2684137ff4cSJacques VidrineThe 2694137ff4cSJacques Vidrine.Nm 2704137ff4cSJacques Vidrinecommand appeared in 2714137ff4cSJacques Vidrine.Bx 4.2 . 2724137ff4cSJacques Vidrine.Sh AUTHORS 2734137ff4cSJacques VidrineThis implementation of 2744137ff4cSJacques Vidrine.Nm 2754137ff4cSJacques Vidrinewas written as part of the Heimdal Kerberos 5 implementation. 2764137ff4cSJacques Vidrine.Sh BUGS 2774137ff4cSJacques VidrineSome shells (notably 2784137ff4cSJacques Vidrine.Xr csh 1 ) 2794137ff4cSJacques Vidrinewill cause 2804137ff4cSJacques Vidrine.Nm 2814137ff4cSJacques Vidrineto block if run in the background, unless the standard input is directed away from the terminal. This is what the 2824137ff4cSJacques Vidrine.Fl n 2834137ff4cSJacques Vidrineoption is for. 2844137ff4cSJacques Vidrine.Pp 2854137ff4cSJacques VidrineThe 2864137ff4cSJacques Vidrine.Fl x 2874137ff4cSJacques Vidrineoptions enables encryption for the session, but for both Kerberos 4 2884137ff4cSJacques Vidrineand 5 the actual command is sent unencrypted, so you should not send 2894137ff4cSJacques Vidrineany secret information in the command line (which is probably a bad 2904137ff4cSJacques Vidrineidea anyway, since the command line can usually be read with tools 2914137ff4cSJacques Vidrinelike 2924137ff4cSJacques Vidrine.Xr ps 1 ) . 293*fc55c203SCy SchubertFurthermore in Kerberos 4 the command is not even integrity 2944137ff4cSJacques Vidrineprotected, so anyone with the right tools can modify the command. 295