Basics

SSH Agent Forwarding and Secure Local Signing

2 min read

SSH Agent Forwarding allows you to use your local SSH keys on a remote server as if they were stored on that server. This is extremely useful when you need to authenticate with a third-party server (like GitHub or a private Git repository) from inside an active SSH terminal session.

However, standard agent forwarding is one of the most common security holes in server administration.

The risk of standard agent forwarding (ssh -A)

When you run ssh -A user@remote-server, SSH creates a socket file on the remote server and forwards any authentication requests back to the SSH Agent running on your local Mac.

The critical danger: anyone with root access (sudo) on the remote server can access that socket file.

If the remote server is compromised, an attacker can use your forwarded socket to sign authentication challenges and gain access to your other servers, Git repositories, or APIs — using your private keys without ever seeing them.

The native solution: secure in-process agent

To make agent forwarding safe, Upshell does not expose your local SSH Agent socket globally. Instead, it runs an in-process secure agent:

  1. Gated per host: Agent forwarding is never enabled globally. You explicitly authorize it only for the servers that strictly need it (e.g. your deploy runner).
  2. Read & Sign limits: The agent only handles signature signing challenges for the current channel.
  3. Keychain bound: Private keys remain locked inside the macOS sandboxed Keychain. No socket files are created on the remote server’s file system.
  4. Interactive approvals: When a remote server requests a signature via the forwarded agent, Upshell pops up a secure notification, allowing you to approve or deny the signing attempt.

How to configure it safely

On your Mac:

In Upshell, open your host settings. Under the Security tab, toggle Enable Agent Forwarding to ON. Since this is gated per host, only this connection will carry the signing bridge.

On the remote server:

Verify that your forwarded key is accessible by running:

ssh-add -l

This should list the fingerprint of the keys stored in your local Mac Keychain. You can now clone Git repositories using your SSH credentials without copying keys to the server:

git clone git@github.com:acme/private-project.git

Upstream — the native FTP, FTPS & SFTP client for macOS

A transfer queue you can pause, resume and reorder, folder synchronization with a dry-run preview, live remote editing and credentials in the macOS Keychain. Free to download, no subscription.