Trust abuse

The r-commands authenticate by host-based trust: .rhosts (per user) and /etc/hosts.equiv (system-wide) grant passwordless access to listed host/user pairs, checked by source address. Attacks are planting a .rhosts entry, abusing a permissive or wildcard trust, exploiting hosts.equiv breadth, and spoofing a trusted source IP, all giving passwordless access across rsh, rlogin, and rexec.

1 min di letturaaggiornato il 7 ott 2026florianamette1 contributore
Chiedi al tuo assistente (MCP)Modifica su GitHub

The defining weakness of rsh and rlogin is their host-based trust: ~/.rhosts (per user) and /etc/hosts.equiv (system-wide) can grant passwordless access based on the connecting host and remote username. This is authentication by spoofable network identity, and it is abused four ways: planting a .rhosts entry where a home is writable, exploiting a permissive or wildcard rule, leveraging a broad hosts.equiv rule, and spoofing a trusted source IP to satisfy the check without controlling the trusted host. A host-only hosts.equiv entry normally permits access only to a like-named local account; an explicit username or wildcard can broaden that access. rexec is separate: it sends a username and password and does not use these trust files.

bash
# read existing trust where files are accessible (reveals who is trusted)
cat ~*/.rhosts /etc/hosts.equiv 2>/dev/null
# a matching rule can yield passwordless rsh/rlogin access

Subtopics#

References#