rsh — Remote shell — DEPRECATED unencrypted predecessor to ssh across all 5 shells
Equivalents in every shell
ssh user@host commandUse `ssh` — `rsh` was removed from most distros (Debian dropped `rsh-client` from default repos; Red Hat removed it in RHEL 9). When migrating legacy scripts, `ssh -o BatchMode=yes user@host command` is the closest behavioural drop-in: non-interactive, command-then-exit.
ssh user@host commandmacOS removed `rsh` in 10.13 (High Sierra). The `ssh` binary in /usr/bin handles the same use case; for scripts that relied on `rsh`'s lack of authentication, you must now configure `~/.ssh/authorized_keys` on the remote.
ssh user@host commandSame — `rsh` is not shipped on any modern Unix. Fish has nothing to add here; the migration is `ssh` everywhere.
ssh user@host commandWindows never shipped `rsh.exe` outside the deprecated Subsystem for Unix Applications (SUA, removed in Windows 8). Use `ssh` (built-in OpenSSH client since Windows 10 1809) or `Invoke-Command -ComputerName host -ScriptBlock { ... }` for native PS Remoting over WinRM/WSMan.
ssh user@host commandNo native `rsh` in cmd. `ssh` from OpenSSH-for-Windows works identically. For Windows-to-Windows remoting, `winrs -r:host command` (built-in since Windows Vista) is the WinRM-based equivalent and uses Kerberos / NTLM rather than SSH keys.
Worked examples
Run a single command on a remote host (the legacy `rsh` use case)
ssh user@host "uptime"ssh user@host "uptime"winrs -r:host hostnameMigrate a legacy `rsh user@host script.sh` invocation
ssh -o BatchMode=yes user@host bash -s < script.shInvoke-Command -ComputerName host -FilePath .\script.ps1Run as a different user remotely
ssh -l otheruser host "id"ssh otheruser@host "id"Gotchas
- `rsh` sent the password and ALL session traffic IN PLAINTEXT over TCP/513. Anyone on the same network segment could read credentials with `tcpdump`. This is THE reason it was removed — there is no "make it secure" flag. If you find an active `rsh` daemon, treat it as a security incident, not a configuration question.
- Some legacy clusters (especially older HPC scheduler installs) still expect `$RSH=ssh` to be set so MPI launch wrappers (`mpirun`, `pdsh`) substitute ssh under the hood. Set `export RSH=ssh` and `export PDSH_RCMD_TYPE=ssh` in `~/.bashrc` on those systems.
- BSD `rsh` had implicit IDENT-based auth via `~/.rhosts` and `/etc/hosts.equiv` — host-trust without per-user passwords. The ssh equivalent is `~/.ssh/authorized_keys` (per-user keys) or `HostbasedAuthentication yes` in sshd_config (closer to the .rhosts model, rarely used today). Do NOT recreate the .rhosts model in production.
- The `r-commands` family (`rsh`, `rlogin`, `rcp`, `rexec`, `rwho`) all share the same insecure design — and the same fixes: `ssh`/`ssh user@host`/`scp`/`ssh ... command`/`who --hosts` over ssh. Migrate the whole family in one sweep, not one-by-one.
- On systems where `rsh` is still installed (older Solaris, AIX, ancient Debian Stretch), the binary may be a SETUID symlink that lets unprivileged users open low ports — a privilege-escalation vector. Run `find / -perm -4000 -name "rsh*"` during hardening and remove what you find.