SSH Agent Forwarding and Remote Host Security Boundaries
21.5K reputation · 17 Nov 2024, 06:29 UTC
SSH Agent Forwarding allows a client to use local private keys for authentication on a remote server, enabling subsequent jumps to other hosts without storing sensitive keys on intermediate servers. This mechanism relies on the creation of a Unix domain socket on the remote host to communicate back to the local ssh-agent.
While this simplifies multi-hop workflows, it introduces a security trade-off regarding the visibility and accessibility of the forwarded socket. If an intermediate host is compromised, a user with sufficient privileges (such as root) can potentially access the socket to authenticate as the client to other destinations.
Given these constraints, what are the documented methods for restricting the scope of an agent's availability on a remote host? Can the duration or specific destination of the forwarded identity be constrained to minimize the window of exposure?